summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_nht.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-06-11 18:19:12 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-06-11 18:19:12 +0200
commit8a92a8a00ca49ad801dbcfcd02bfb65ea1f4b83e (patch)
treea33248e6de30e1c443af56b792d4a26b258e742f /bgpd/bgp_nht.c
parentzebra, bgpd, ospfd: 'redistribute table' to 'redistribute table <table-id>' (diff)
downloadfrr-8a92a8a00ca49ad801dbcfcd02bfb65ea1f4b83e.tar.xz
frr-8a92a8a00ca49ad801dbcfcd02bfb65ea1f4b83e.zip
bgpd, zebra: rfc-5549-generic.patch
This adds support for BGP RFC 5549 (Extended Next Hop Encoding capability) * send and receive of the capability * processing of IPv4->IPv6 next-hops * for resolving these IPv6 next-hops, itsworks with the current next-hop-tracking support * added a new message type between BGP and Zebra for such route install/uninstall * zserv side of changes to process IPv4 prefix ->IPv6 next-hops * required show command changes for IPv4 prefix having IPv6 next-hops Few points to note about the implementation: * It does an implicit next-hop-self when a [IPv4 prefix -> IPv6 LL next-hop] is to be considered for advertisement to IPv4 peering (or IPv6 peering without Extended next-hop capability negotiated) * Currently feature is off by default, enable it by configuring 'neighbor <> capability extended-nexthop' * Current support is for IPv4 Unicast prefixes only. IMPORTANT NOTE: This patch alone isn't enough to have IPv4->IPv6 routes installed into the kernel. A separate patch is needed for that to work for the netlink interface. Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com> Vivek Venkatraman <vivek@cumulusnetworks.com> Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_nht.c')
-rw-r--r--bgpd/bgp_nht.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
index da52064ae..397b379fa 100644
--- a/bgpd/bgp_nht.c
+++ b/bgpd/bgp_nht.c
@@ -103,11 +103,17 @@ bgp_find_or_add_nexthop (struct bgp *bgp, afi_t afi, struct bgp_info *ri,
if (ri)
{
+ is_bgp_static_route = ((ri->type == ZEBRA_ROUTE_BGP) &&
+ (ri->sub_type == BGP_ROUTE_STATIC)) ? 1 : 0;
+
+ /* Since Extended Next-hop Encoding (RFC5549) support, we want to derive
+ address-family from the next-hop. */
+ if (!is_bgp_static_route)
+ afi = BGP_ATTR_NEXTHOP_AFI_IP6(ri->attr) ? AFI_IP6 : AFI_IP;
+
/* This will return TRUE if the global IPv6 NH is a link local addr */
if (make_prefix(afi, ri, &p) < 0)
return 1;
- is_bgp_static_route = ((ri->type == ZEBRA_ROUTE_BGP) &&
- (ri->sub_type == BGP_ROUTE_STATIC)) ? 1 : 0;
}
else if (peer)
{