chiark / gitweb /
networkd: restore logic for enslaving to a master bonding interface
authorMark Oteiza <mvoteiza@udel.edu>
Wed, 5 Mar 2014 09:41:13 +0000 (10:41 +0100)
committerTom Gundersen <teg@jklm.no>
Wed, 5 Mar 2014 09:41:20 +0000 (10:41 +0100)
This partially reverts commit 54abf46, which unintentionally removed the
enslaving support for bonding interfaces

src/network/networkd-link.c

index c10d947..61e257c 100644 (file)
@@ -1194,6 +1194,27 @@ static int link_enter_enslave(Link *link) {
                 link->enslaving ++;
         }
 
+        if (link->network->bond) {
+                log_struct_link(LOG_DEBUG, link,
+                                "MESSAGE=%s: enslaving by '%s'",
+                                link->ifname, link->network->bond->name,
+                                NETDEV(link->network->bond),
+                                NULL);
+
+                r = netdev_enslave(link->network->bond, link, &enslave_handler);
+                if (r < 0) {
+                        log_struct_link(LOG_WARNING, link,
+                                        "MESSAGE=%s: could not enslave by '%s': %s",
+                                        link->ifname, link->network->bond->name, strerror(-r),
+                                        NETDEV(link->network->bond),
+                                        NULL);
+                        link_enter_failed(link);
+                        return r;
+                }
+
+                link->enslaving ++;
+        }
+
         HASHMAP_FOREACH(vlan, link->network->vlans, i) {
                 log_struct_link(LOG_DEBUG, link,
                                 "MESSAGE=%s: enslaving by '%s'",