summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>2009-01-21 16:41:22 +0100
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-06 15:32:19 -0700
commit06252a4d3875bfd2e986ef0da86c4b111e7e2ce2 (patch)
treeefa1fc4574a8ce3f565615118cec4cbdff44528c /zebra/zebra_rib.c
parent8c502f355ed9860178f6a2fa545024945fb942dd (diff)
downloadquagga-06252a4d3875bfd2e986ef0da86c4b111e7e2ce2.tar.bz2
quagga-06252a4d3875bfd2e986ef0da86c4b111e7e2ce2.tar.xz
Don't delete too many routes.
If there are two paralell PtP links to the same router: C * 192.168.101.112/32 is directly connected, p1-4-19-4-20 C>* 192.168.101.112/32 is directly connected, p1-4-17-4-18 and the cable is to one of the ppp links is pulled, Zebra deletes both routes instead of just the one that got yanked. This fixes it to only delete the route to the interface that got yanked.
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index d4395db1..5ea93112 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -2013,6 +2013,13 @@ rib_delete_ipv4 (int type, int flags, struct prefix_ipv4 *p,
inet_ntoa (*gate),
ifindex);
+ if (IS_ZEBRA_DEBUG_KERNEL && !gate)
+ zlog_debug ("rib_delete_ipv4(): route delete %s/%d directly, %s ifindex %d",
+ inet_ntop (AF_INET, &p->prefix, buf1, BUFSIZ),
+ p->prefixlen,
+ ifindex2ifname(ifindex),
+ ifindex);
+
/* Lookup route node. */
rn = route_node_lookup (table, (struct prefix *) p);
if (! rn)
@@ -2059,7 +2066,7 @@ rib_delete_ipv4 (int type, int flags, struct prefix_ipv4 *p,
break;
}
/* Make sure that the route found has the same gateway. */
- else if (gate == NULL ||
+ else if (gate != NULL &&
((nexthop = rib->nexthop) &&
(IPV4_ADDR_SAME (&nexthop->gate.ipv4, gate) ||
IPV4_ADDR_SAME (&nexthop->rgate.ipv4, gate))))