From a01fbfafd4fc9add1947853ad15570e14ea6f43b Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 21 Apr 2011 16:37:38 -0700 Subject: [PATCH] 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). --- vswitchd/bridge.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; } -- 2.43.0