summaryrefslogtreecommitdiffstats
path: root/main/quagga/quagga-0.99.11-del-routes.patch
blob: 72ee89929cf16af5ad20a37d59455f5a579fbffa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From http://lists.quagga.net/pipermail/quagga-dev/2009-January/006362.html

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.
---
This fix was suggested by lsorense at csclub.uwaterloo.ca (Lennart Sorensen)
who had a similar problem. See [quagga-dev 6355]

 zebra/zebra_rib.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 90db932..7a37387 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1896,6 +1896,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)
@@ -1942,7 +1949,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))))