The code in this function to call bundle_remove() dates back to before
netdevs had a reference count.  At that time, when the caller closed the
ofport's netdev, any further reference to that netdev from the bond would
access freed memory.  Now that netdevs are ref-counted, it's no longer a
problem, so removed the call.

Signed-off-by: Ben Pfaff <b...@nicira.com>
---
 ofproto/ofproto-dpif.c |   14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 820ec34..82c2a7f 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -3099,17 +3099,9 @@ port_del(struct ofproto *ofproto_, ofp_port_t ofp_port)
     sset_find_and_delete(&ofproto->ghost_ports,
                          netdev_get_name(ofport->up.netdev));
     ofproto->backer->need_revalidate = REV_RECONFIGURE;
-    if (!ofport->is_tunnel) {
-        error = dpif_port_del(ofproto->backer->dpif, ofport->odp_port);
-        if (!error) {
-            /* The caller is going to close ofport->up.netdev.  If this is a
-             * bonded port, then the bond is using that netdev, so remove it
-             * from the bond.  The client will need to reconfigure everything
-             * after deleting ports, so then the slave will get re-added. */
-            bundle_remove(&ofport->up);
-        }
-    }
-    return error;
+    return (!ofport->is_tunnel
+            ? dpif_port_del(ofproto->backer->dpif, ofport->odp_port)
+            : 0);
 }
 
 static int
-- 
1.7.10.4

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to