[ovs-dev] [PATCH] bonding: Update the link status on the bond fake interface.

Jesse Gross jesse at nicira.com
Sat Oct 3 01:18:59 UTC 2009


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 |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 2d788ae..e350b7b 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -2973,6 +2973,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);
 }
-- 
1.6.0.4





More information about the dev mailing list