summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2017-01-06 13:35:40 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2017-01-17 12:13:11 +0100
commitcf6c0c088ecaeca16784c313234df6e11cd8584f (patch)
tree12b75917aadd3d472f2fd87557518feb0dce0cf8 /bgpd
parentMerge pull request #67 from opensourcerouting/stable-test-fixes (diff)
downloadfrr-cf6c0c088ecaeca16784c313234df6e11cd8584f.tar.xz
frr-cf6c0c088ecaeca16784c313234df6e11cd8584f.zip
bgpd: fix nexthop comparison for nexthop vpnv6 attribute
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>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_mpath.c2
-rw-r--r--bgpd/bgp_route.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c
index c9af8419f..dc8904ced 100644
--- a/bgpd/bgp_mpath.c
+++ b/bgpd/bgp_mpath.c
@@ -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;
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 9e1ae854d..90904e946 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -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));