summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2013-05-25 14:01:35 +0000
committerDavid Lamparter <equinox@opensourcerouting.org>2013-08-06 12:41:46 +0200
commitbb97e4622ed6f48e2b8e07f1f94edd03162223a1 (patch)
tree5729ccb02f1de89d4d9bbe5b537de45803d1cf55 /bgpd
parent5b9f51828db732d56053500b1d257797f7f3401b (diff)
bgpd, zebra: Support NEXTHOP_IPV4_IFINDEX in nexthop_lookup api
Since commit ba281d3d040, ospfd uses NEXTHOP_IPV4_IFINDEX routes. The API between zebra and bgpd which is used to query nexthops for recursive routes did not support this nexthop type and therefore, ospf changes (or any other IGP changes which use NEXTHOP_IPV4_IFINDEX) would never trigger any recursive route update. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_nexthop.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index 17586bc8..7d8d8665 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -122,6 +122,11 @@ bgp_nexthop_same (struct nexthop *next1, struct nexthop *next2)
if (! IPV4_ADDR_SAME (&next1->gate.ipv4, &next2->gate.ipv4))
return 0;
break;
+ case ZEBRA_NEXTHOP_IPV4_IFINDEX:
+ if (! IPV4_ADDR_SAME (&next1->gate.ipv4, &next2->gate.ipv4)
+ || next1->ifindex != next2->ifindex)
+ return 0;
+ break;
case ZEBRA_NEXTHOP_IFINDEX:
case ZEBRA_NEXTHOP_IFNAME:
if (next1->ifindex != next2->ifindex)
@@ -832,6 +837,10 @@ zlookup_read (void)
case ZEBRA_NEXTHOP_IPV4:
nexthop->gate.ipv4.s_addr = stream_get_ipv4 (s);
break;
+ case ZEBRA_NEXTHOP_IPV4_IFINDEX:
+ nexthop->gate.ipv4.s_addr = stream_get_ipv4 (s);
+ nexthop->ifindex = stream_getl (s);
+ break;
case ZEBRA_NEXTHOP_IFINDEX:
case ZEBRA_NEXTHOP_IFNAME:
nexthop->ifindex = stream_getl (s);
@@ -1304,6 +1313,10 @@ show_ip_bgp_scan_tables (struct vty *vty, const char detail)
case NEXTHOP_TYPE_IPV4:
vty_out (vty, " gate %s%s", inet_ntop (AF_INET, &bnc->nexthop[i].gate.ipv4, buf, INET6_ADDRSTRLEN), VTY_NEWLINE);
break;
+ case NEXTHOP_TYPE_IPV4_IFINDEX:
+ vty_out (vty, " gate %s", inet_ntop (AF_INET, &bnc->nexthop[i].gate.ipv4, buf, INET6_ADDRSTRLEN));
+ vty_out (vty, " ifidx %u%s", bnc->nexthop[i].ifindex, VTY_NEWLINE);
+ break;
case NEXTHOP_TYPE_IFINDEX:
vty_out (vty, " ifidx %u%s", bnc->nexthop[i].ifindex, VTY_NEWLINE);
break;