summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_updgrp_packet.c
diff options
context:
space:
mode:
authorvivek <vivek@cumulusnetworks.com>2017-05-24 23:57:34 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-12 18:34:34 +0200
commit3684a40babc05156b84ff4a28842f43a98c65ecc (patch)
treec084c9cfe569796a1181cdbf0d04c50274a749b2 /bgpd/bgp_updgrp_packet.c
parentbgpd: Fix check for martian next hops (diff)
downloadfrr-3684a40babc05156b84ff4a28842f43a98c65ecc.tar.xz
frr-3684a40babc05156b84ff4a28842f43a98c65ecc.zip
bgpd: Fix next hop setting for EVPN
The next hop for EVPN routes must be an IPv4 or IPv6 address as per RFC 7432. Ensure this is correctly handled. Also, ensure there are correct checks for AFI_L2VPN and nexthop AFI is not AFI_L2VPN. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_updgrp_packet.c')
-rw-r--r--bgpd/bgp_updgrp_packet.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c
index dff46a946..cecb844fc 100644
--- a/bgpd/bgp_updgrp_packet.c
+++ b/bgpd/bgp_updgrp_packet.c
@@ -423,12 +423,10 @@ bpacket_reformat_for_peer (struct bpacket *pkt, struct peer_af *paf)
afi_t nhafi = AFI_MAX; /* NH AFI is based on nhlen! */
int route_map_sets_nh;
nhlen = stream_getc_from (s, vec->offset);
- if (paf->afi == AFI_IP || paf->afi == AFI_IP6)
- {
- nhafi = BGP_NEXTHOP_AFI_FROM_NHLEN(nhlen);
- if (peer_cap_enhe(peer, paf->afi, paf->safi))
- nhafi = AFI_IP6;
- }
+ if (peer_cap_enhe(peer, paf->afi, paf->safi))
+ nhafi = AFI_IP6;
+ else
+ nhafi = BGP_NEXTHOP_AFI_FROM_NHLEN(nhlen);
if (nhafi == AFI_IP)
{