summaryrefslogtreecommitdiffstats
path: root/zebra/connected.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-29 22:16:00 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-29 23:09:06 -0700
commit3a0ab9d1718175098bebca664f2004ec4daacfed (patch)
tree5ba6a7353686ffca0841fd69404ca079653c3f62 /zebra/connected.c
parent11bbc07a287d883f3013567f897290859c428286 (diff)
downloadquagga-3a0ab9d1718175098bebca664f2004ec4daacfed.tar.bz2
quagga-3a0ab9d1718175098bebca664f2004ec4daacfed.tar.xz
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, ...
Diffstat (limited to 'zebra/connected.c')
-rw-r--r--zebra/connected.c9
1 files changed, 8 insertions, 1 deletions
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);