]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: fix nexthop comparison for nexthop vpnv6 attribute
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 6 Jan 2017 12:35:40 +0000 (13:35 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 17 Jan 2017 11:13:11 +0000 (12:13 +0100)
As nexthop attribute for vpnv6 also contains a blank RD and a blank tag,
the IPv6 address length increases from 16 to 24 bytes. The same was
observed for vpnv4 nexthop, but was missing for VPNv6.
The same is done for martian nexthop debugging.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_mpath.c
bgpd/bgp_route.c

index c9af8419f270759d1bfa2edfc40376d0d9eaaae1..dc8904ced28d5ab959a424248b96254bbb2081e0 100644 (file)
@@ -113,7 +113,6 @@ bgp_info_nexthop_cmp (struct bgp_info *bi1, struct bgp_info *bi2)
   ae2 = bi2->attr->extra;
 
   compare = IPV4_ADDR_CMP (&bi1->attr->nexthop, &bi2->attr->nexthop);
-
   if (!compare && ae1 && ae2)
     {
       if (ae1->mp_nexthop_len == ae2->mp_nexthop_len)
@@ -127,6 +126,7 @@ bgp_info_nexthop_cmp (struct bgp_info *bi1, struct bgp_info *bi2)
               break;
 #ifdef HAVE_IPV6
             case BGP_ATTR_NHLEN_IPV6_GLOBAL:
+            case BGP_ATTR_NHLEN_VPNV6_GLOBAL:
               compare = IPV6_ADDR_CMP (&ae1->mp_nexthop_global,
                                        &ae2->mp_nexthop_global);
               break;
index 9e1ae854d476777e4a7c63b924621f1cfbf0eea5..90904e946c7412aa43fcb4b2e0e797a702582235 100644 (file)
@@ -2321,6 +2321,7 @@ bgp_update_martian_nexthop (struct bgp *bgp, afi_t afi, safi_t safi, struct attr
 #ifdef HAVE_IPV6
         case BGP_ATTR_NHLEN_IPV6_GLOBAL:
         case BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL:
+        case BGP_ATTR_NHLEN_VPNV6_GLOBAL:
           ret = (IN6_IS_ADDR_UNSPECIFIED(&attre->mp_nexthop_global) ||
                  IN6_IS_ADDR_LOOPBACK(&attre->mp_nexthop_global)    ||
                  IN6_IS_ADDR_MULTICAST(&attre->mp_nexthop_global));