summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-07-01 13:30:23 +0200
committerTom Gundersen <teg@jklm.no>2014-07-01 13:30:23 +0200
commit856f962c7a2e13b33f5b1c691efb2780f2c7afc3 (patch)
tree8c34fe5bdb059e8abeb885595204ea5600ca9921
parentd5b3d845f013f7f332c76e83bb8e867de7d3caee (diff)
networkd: link - don't fail if master netdev already exists
This allows restarts to work gracefully.
-rw-r--r--src/network/networkd-link.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index ce9fbb5ed8..a523a3e9b2 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1723,6 +1723,8 @@ static int link_enslaved(Link *link) {
assert(link->state == LINK_STATE_ENSLAVING);
assert(link->network);
+ log_debug_link(link, "enslaved");
+
if (!(link->flags & IFF_UP)) {
r = link_up(link);
if (r < 0) {
@@ -1749,7 +1751,7 @@ static int enslave_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
return 1;
r = sd_rtnl_message_get_errno(m);
- if (r < 0) {
+ if (r < 0 && r != -EEXIST) {
log_struct_link(LOG_ERR, link,
"MESSAGE=%-*s: could not enslave: %s",
IFNAMSIZ,
@@ -1760,9 +1762,7 @@ static int enslave_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
return 1;
}
- log_debug_link(link, "enslaved");
-
- if (link->enslaving == 0)
+ if (link->enslaving <= 0)
link_enslaved(link);
return 1;