]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fixup bgpd: allow VPN next hop to be different AFI than NLRI next
authorPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 10 May 2017 17:27:33 +0000 (19:27 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 10 May 2017 17:27:33 +0000 (19:27 +0200)
hop for EVPN

In the case of EVPN, add the nexthop attribute.

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

index b2789cd47dcc4cfd542f8144994abc2fb9e4d3b3..8b4ea9c752a83bce59edb0493b12b095e8ecb0d6 100644 (file)
@@ -2847,8 +2847,9 @@ bgp_packet_mpattr_start (struct stream *s, afi_t afi, safi_t safi, afi_t nh_afi,
 
   stream_putw (s, pkt_afi);    /* AFI */
   stream_putc (s, pkt_safi);   /* SAFI */
-
-  if (nh_afi == AFI_MAX)
+  if (afi == AFI_L2VPN)
+    nh_afi = AFI_L2VPN;
+  else if (nh_afi == AFI_MAX)
     nh_afi = BGP_NEXTHOP_AFI_FROM_NHLEN(attr->extra->mp_nexthop_len);
 
   /* Nexthop */