From ed936467a9f7ce543ffd214205b96c45e2de3f63 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 29 Dec 2008 16:01:46 -0800 Subject: [PATCH] vswitchd: Properly renumber port_ifidx values on iface destruction. --- vswitchd/bridge.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- 2.30.2