vswitchd: Don't try to delete local port from datapath.
authorBen Pfaff <blp@nicira.com>
Tue, 30 Dec 2008 21:53:18 +0000 (13:53 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 30 Dec 2008 21:53:18 +0000 (13:53 -0800)
The local port (OFFP_LOCAL) is fixed in place and can't be deleted, so
don't try.

vswitchd/bridge.c

index fc6bc631583f6193768074549739735e7126d64a..fc733536829605da276c2a37ddad29e9e8ebc76a 100644 (file)
@@ -263,10 +263,14 @@ bridge_reconfigure(void)
         svec_diff(&want_ifaces, &cur_ifaces, NULL, NULL, &del_ifaces);
         for (i = 0; i < del_ifaces.n; i++) {
             const char *if_name = del_ifaces.names[i];
-            int retval = dpif_del_port(&mgmt_dpif, br->dp_idx, if_name);
-            if (retval) {
-                VLOG_ERR("failed to remove %s interface from nl:%d: %s",
-                         if_name, br->dp_idx, strerror(retval));
+            if (strcmp(if_name, br->name)) {
+                int retval = dpif_del_port(&mgmt_dpif, br->dp_idx, if_name);
+                if (retval) {
+                    VLOG_ERR("failed to remove %s interface from nl:%d: %s",
+                             if_name, br->dp_idx, strerror(retval));
+                }
+            } else {
+                /* Can't remove local port. */
             }
         }
         svec_destroy(&cur_ifaces);