vswitchd: Properly renumber port_ifidx values on iface destruction.
authorBen Pfaff <blp@nicira.com>
Tue, 30 Dec 2008 00:01:46 +0000 (16:01 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 30 Dec 2008 00:02:29 +0000 (16:02 -0800)
vswitchd/bridge.c

index d58e635a309b6b05702155bcb158e07e9585aef9..139d7f97839df3ed3cd42b9297465b91868abff9 100644 (file)
@@ -2156,7 +2156,11 @@ iface_destroy(struct iface *iface)
 {
     if (iface) {
         struct port *port = iface->port;
-        port->ifaces[iface->port_ifidx] = port->ifaces[--port->n_ifaces];
+        struct iface *del;
+
+        del = port->ifaces[iface->port_ifidx] = port->ifaces[--port->n_ifaces];
+        del->port_ifidx = iface->port_ifidx;
+
         free(iface->name);
         free(iface);