diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index a0e8d5499b..cc2e23ec04 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -2812,6 +2812,39 @@ bgp_packet_mpattr_start (struct stream *s, afi_t afi, safi_t safi, afi_t nh_afi, break; } break; + case AFI_L2VPN: + switch (safi) + { + case SAFI_EVPN: + if (attr->extra->mp_nexthop_len == BGP_ATTR_NHLEN_VPNV4) + { + stream_putc (s, 12); + stream_putl (s, 0); /* RD = 0, per RFC */ + stream_putl (s, 0); + stream_put (s, &attr->extra->mp_nexthop_global_in, 4); + } + else if (attr->extra->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL) + { + stream_putc (s, 24); + stream_putl (s, 0); /* RD = 0, per RFC */ + stream_putl (s, 0); + stream_put (s, &attr->extra->mp_nexthop_global, IPV6_MAX_BYTELEN); + } + else if (attr->extra->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL) + { + stream_putc (s, 48); + stream_putl (s, 0); /* RD = 0, per RFC */ + stream_putl (s, 0); + stream_put (s, &attr->extra->mp_nexthop_global, IPV6_MAX_BYTELEN); + stream_putl (s, 0); /* RD = 0, per RFC */ + stream_putl (s, 0); + stream_put (s, &attr->extra->mp_nexthop_local, IPV6_MAX_BYTELEN); + } + break; + break; + default: + break; + } default: break; }