]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Use better 5549 resolution
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 30 Mar 2017 13:07:06 +0000 (09:07 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 30 Mar 2017 13:34:03 +0000 (09:34 -0400)
When we receive a v6 nexthop in v4, lookup the nbr by
it's secondary address.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_zlookup.c

index f77990ab5ab81faa3b7e05ec34f850ce65e330aa..620137b33b573c25bc6c0d9beda064b502d6919f 100644 (file)
@@ -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;