From: Ben Pfaff Date: Thu, 21 Apr 2011 23:37:38 +0000 (-0700) Subject: bridge: Remove slaves from the bond before closing their netdevs. X-Git-Tag: v1.2.0~411 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=a01fbfafd4fc9add1947853ad15570e14ea6f43b;p=sliver-openvswitch.git bridge: Remove slaves from the bond before closing their netdevs. A bond slave has a pointer to its iface's netdev, so we don't want it to keep that pointer after the bridge closes the netdev. This is becoming a bit of a mess so perhaps we need reference counting for netdevs (although Jesse didn't like the idea when I proposed it before). --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 3c9b05f3b..20ecca356 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -664,6 +664,13 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg) dpif_port = NULL; } if (iface) { + if (iface->port->bond) { + /* The bond has a pointer to the netdev, so remove it + * from the bond before closing the netdev. The slave + * will get added back to the bond later, after a new + * netdev is available. */ + bond_slave_unregister(iface->port->bond, iface); + } netdev_close(iface->netdev); iface->netdev = NULL; }