From ec22de20ab78db7be405e7361df8e98188c1ece5 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Mon, 1 Feb 2010 16:41:26 +0100 Subject: zebra: fix bug #486 (lingering after IP address deletion) zebra address bookkeeping is a mess. this is just a workaround to have IPv4 address deletion somewhat working on Linux. the if_unset_prefix call is synchronous, when it returns success the address deletion completed successfully. this is either signaled by a netlink ACK or by an OK return value from ioctl(). [cherry-picked from 48f685f3...] --- zebra/interface.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'zebra/interface.c') diff --git a/zebra/interface.c b/zebra/interface.c index ba4cf25f..aa078925 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1279,18 +1279,23 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, safe_strerror(errno), VTY_NEWLINE); return CMD_WARNING; } + /* success! now update all internal state... */ + + /* Remove connected route. */ + connected_down_ipv4 (ifp, ifc); -#if 0 /* Redistribute this information. */ zebra_interface_address_delete_update (ifp, ifc); - /* Remove connected route. */ - connected_down_ipv4 (ifp, ifc); + /* IP address propery set. */ + UNSET_FLAG (ifc->conf, ZEBRA_IFC_REAL); + + /* remove from interface, remark secondaries */ + if_subnet_delete (ifp, ifc); /* Free address information. */ listnode_delete (ifp->connected, ifc); connected_free (ifc); -#endif return CMD_SUCCESS; } -- cgit v1.2.3