summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-06-11 09:19:12 -0700
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-06-11 09:19:12 -0700
commit8a92a8a00ca49ad801dbcfcd02bfb65ea1f4b83e (patch)
treea33248e6de30e1c443af56b792d4a26b258e742f /zebra/zebra_rib.c
parent2d627ff50c181a26839aef7c0fc48ea4621b3e64 (diff)
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 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c45
1 files changed, 30 insertions, 15 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index db679e8575..7adbcbe534 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -3221,7 +3221,7 @@ rib_add_ipv6 (int type, u_short instance, int flags, struct prefix_ipv6 *p,
}
int
-rib_add_ipv6_multipath (struct prefix_ipv6 *p, struct rib *rib, safi_t safi,
+rib_add_ipv6_multipath (struct prefix *p, struct rib *rib, safi_t safi,
unsigned long ifindex)
{
struct route_table *table;
@@ -3231,26 +3231,41 @@ rib_add_ipv6_multipath (struct prefix_ipv6 *p, struct rib *rib, safi_t safi,
int ret = 0;
unsigned int table_id = 0;
- if (rib)
- table_id = rib->table;
- else
- return 0; /* why are we getting called with NULL rib */
-
- /* Lookup table. */
- if ((table_id == RT_TABLE_MAIN) || (table_id == zebrad.rtm_table_default))
+ if (p->family == AF_INET)
{
- table = vrf_table (AFI_IP6, safi, 0);
+ if (!rib)
+ return 0;
+
+ table = vrf_table (AFI_IP, safi, 0);
+ if (!table)
+ return 0;
+ /* Make it sure prefixlen is applied to the prefix. */
+ apply_mask_ipv4 (p);
}
else
{
- table = vrf_other_route_table(AFI_IP6, table_id, 0);
- }
+ if (rib)
+ table_id = rib->table;
+ else
+ return 0; /* why are we getting called with NULL rib */
- if (! table)
- return 0;
+ /* Lookup table. */
+ if ((table_id == RT_TABLE_MAIN) || (table_id == zebrad.rtm_table_default))
+ {
+ table = vrf_table (AFI_IP6, safi, 0);
+ }
+ else
+ {
+ table = vrf_other_route_table(AFI_IP6, table_id, 0);
+ }
- /* Make sure mask is applied. */
- apply_mask_ipv6 (p);
+ if (! table)
+ return 0;
+
+ /* Make sure mask is applied. */
+ apply_mask_ipv6 (p);
+
+ }
/* Set default distance by route type. */
if (rib->distance == 0)