Mailing List Archive

[PATCH 44/57] bgpd: MAC/IP advertisements have next hop attribute
When sending an EVPN MAC/IP attribute, the nexthop attribute is also
appended.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
---
bgpd/bgp_attr.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 2b57d687800c..eb13e1762b1d 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -2860,13 +2860,15 @@ bgp_packet_attribute (struct bgp *bgp, struct peer *peer,
send_as4_path = 1; /* we'll do this later, at the correct place */

/* Nexthop attribute. */
- if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_NEXT_HOP) && afi == AFI_IP &&
- safi == SAFI_UNICAST) /* only write NH attr for unicast safi */
+ if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_NEXT_HOP) &&
+ ((afi == AFI_IP && safi == SAFI_UNICAST) || /* only write NH attr for unicast safi */
+ (safi == SAFI_MPLS_VPN) || /* only write NH attr for unicast safi */
+ (afi == AFI_INTERNAL_L2VPN && safi == SAFI_INTERNAL_EVPN)))
{
stream_putc (s, BGP_ATTR_FLAG_TRANS);
stream_putc (s, BGP_ATTR_NEXT_HOP);
stream_putc (s, 4);
- if (safi == SAFI_MPLS_VPN)
+ if ( (safi == SAFI_MPLS_VPN) || ( safi == SAFI_INTERNAL_EVPN))
{
if (attr->nexthop.s_addr == 0)
stream_put_ipv4 (s, peer->nexthop.v4.s_addr);
--
2.1.4


_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev