From: Ben Pfaff Date: Tue, 30 Dec 2008 00:01:46 +0000 (-0800) Subject: vswitchd: Properly renumber port_ifidx values on iface destruction. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed936467a9f7ce543ffd214205b96c45e2de3f63;p=openvswitch vswitchd: Properly renumber port_ifidx values on iface destruction. --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index d58e635a..139d7f97 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -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);