bonding: Update the link status on the bond fake interface.
authorJesse Gross <jesse@nicira.com>
Sat, 3 Oct 2009 01:08:05 +0000 (18:08 -0700)
committerJesse Gross <jesse@nicira.com>
Mon, 5 Oct 2009 17:27:29 +0000 (10:27 -0700)
Brings the fake bond interface up and down to match our notion of
whether the bond is currently active.  This solves an issue where
XenCenter would always show the bond as disconnected.

Bug #1703

vswitchd/bridge.c

index 36be700..f32d2ba 100644 (file)
@@ -2983,6 +2983,19 @@ port_update_bond_compat(struct port *port)
         memcpy(slave->mac, iface->mac, ETH_ADDR_LEN);
     }
 
+    if (cfg_get_bool(0, "bonding.%s.fake-iface", port->name)) {
+        struct netdev *bond_netdev;
+
+        if (!netdev_open(port->name, NETDEV_ETH_TYPE_NONE, &bond_netdev)) {
+            if (bond.up) {
+                netdev_turn_flags_on(bond_netdev, NETDEV_UP, true);
+            } else {
+                netdev_turn_flags_off(bond_netdev, NETDEV_UP, true);
+            }
+            netdev_close(bond_netdev);
+        }
+    }
+
     proc_net_compat_update_bond(port->name, &bond);
     free(bond.slaves);
 }