From 3a0ab9d1718175098bebca664f2004ec4daacfed Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 29 Apr 2009 22:16:00 -0700 Subject: Handle kernel flush when address is deleted When interface addresses are deleted, the kernel will flush all routes. Quagga needs to follow this correctly. Relates to DHCP bugs 4314, 4315, ... --- zebra/connected.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'zebra/connected.c') diff --git a/zebra/connected.c b/zebra/connected.c index a3e20096..80cb8cbc 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -42,18 +42,25 @@ extern struct zebra_t zebrad; static void connected_withdraw (struct connected *ifc) { + if (! ifc) return; /* Update interface address information to protocol daemon. */ if (CHECK_FLAG (ifc->conf, ZEBRA_IFC_REAL)) { + int count; + zebra_interface_address_delete_update (ifc->ifp, ifc); - if_subnet_delete (ifc->ifp, ifc); + count = if_subnet_delete (ifc->ifp, ifc); if (ifc->address->family == AF_INET) + { connected_down_ipv4 (ifc->ifp, ifc); + if (count == 0) + rib_flush_interface (AFI_IP, ifc->ifp); + } #ifdef HAVE_IPV6 else connected_down_ipv6 (ifc->ifp, ifc); -- cgit v1.2.3