updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / quagga / patch-zebra_rib.c.patch
blob72ee89929cf16af5ad20a37d59455f5a579fbffa
1 From http://lists.quagga.net/pipermail/quagga-dev/2009-January/006362.html
3 If there are two paralell PtP links to the same router:
4 C * 192.168.101.112/32 is directly connected, p1-4-19-4-20
5 C>* 192.168.101.112/32 is directly connected, p1-4-17-4-18
6 and the cable is to one of the ppp links is pulled, Zebra
7 deletes both routes instead of just the one that got yanked.
8 This fixes it to only delete the route to the interface that
9 got yanked.
10 ---
11 This fix was suggested by lsorense at csclub.uwaterloo.ca (Lennart Sorensen)
12 who had a similar problem. See [quagga-dev 6355]
14 zebra/zebra_rib.c | 9 ++++++++-
15 1 files changed, 8 insertions(+), 1 deletions(-)
17 diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
18 index 90db932..7a37387 100644
19 --- a/zebra/zebra_rib.c
20 +++ b/zebra/zebra_rib.c
21 @@ -1896,6 +1896,13 @@ rib_delete_ipv4 (int type, int flags, struct prefix_ipv4 *p,
22 inet_ntoa (*gate),
23 ifindex);
25 + if (IS_ZEBRA_DEBUG_KERNEL && !gate)
26 + zlog_debug ("rib_delete_ipv4(): route delete %s/%d directly, %s ifindex %d",
27 + inet_ntop (AF_INET, &p->prefix, buf1, BUFSIZ),
28 + p->prefixlen,
29 + ifindex2ifname(ifindex),
30 + ifindex);
32 /* Lookup route node. */
33 rn = route_node_lookup (table, (struct prefix *) p);
34 if (! rn)
35 @@ -1942,7 +1949,7 @@ rib_delete_ipv4 (int type, int flags, struct prefix_ipv4 *p,
36 break;
38 /* Make sure that the route found has the same gateway. */
39 - else if (gate == NULL ||
40 + else if (gate != NULL &&
41 ((nexthop = rib->nexthop) &&
42 (IPV4_ADDR_SAME (&nexthop->gate.ipv4, gate) ||
43 IPV4_ADDR_SAME (&nexthop->rgate.ipv4, gate))))