summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-03-30 09:07:06 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-03-30 09:34:03 -0400
commiteeff6d3f99c8965bbb4870d9ca0f8da5f6a53e57 (patch)
tree840107eea2ad2c34bb1390b34b1ffb6e7691bdc1
parentdba7860904ec03bf3c856efee1fae9fc06821121 (diff)
pimd: Use better 5549 resolution
When we receive a v6 nexthop in v4, lookup the nbr by it's secondary address. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--pimd/pim_zlookup.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c
index f77990ab5a..620137b33b 100644
--- a/pimd/pim_zlookup.c
+++ b/pimd/pim_zlookup.c
@@ -222,6 +222,7 @@ static int zclient_read_nexthop(struct zclient *zlookup,
for (i = 0; i < nexthop_num; ++i) {
enum nexthop_types_t nexthop_type;
struct pim_neighbor *nbr;
+ struct prefix p;
nexthop_type = stream_getc(s);
if (num_ifindex >= tab_size) {
@@ -253,7 +254,18 @@ static int zclient_read_nexthop(struct zclient *zlookup,
nexthop_tab[num_ifindex].nexthop_addr.family = AF_INET6;
stream_get (&nexthop_tab[num_ifindex].nexthop_addr.u.prefix6, s, 16);
nexthop_tab[num_ifindex].ifindex = stream_getl (s);
- nbr = pim_neighbor_find_if (if_lookup_by_index (nexthop_tab[num_ifindex].ifindex, VRF_DEFAULT));
+
+ p.family = AF_INET6;
+ p.prefixlen = IPV6_MAX_PREFIXLEN;
+ memcpy (&p.u.prefix6, &nexthop_tab[num_ifindex].nexthop_addr.u.prefix6, 16);
+
+ /*
+ * If we are sending v6 secondary assume we receive v6 secondary
+ */
+ if (pimg->send_v6_secondary)
+ nbr = pim_neighbor_find_by_secondary(if_lookup_by_index (nexthop_tab[num_ifindex].ifindex, VRF_DEFAULT), &p);
+ else
+ nbr = pim_neighbor_find_if (if_lookup_by_index (nexthop_tab[num_ifindex].ifindex, VRF_DEFAULT));
if (nbr)
{
nexthop_tab[num_ifindex].nexthop_addr.family = AF_INET;