From 3d22338f04d9554fa79fc993da95868921777354 Mon Sep 17 00:00:00 2001 From: vivek Date: Mon, 15 May 2017 14:28:38 -0700 Subject: [PATCH] bgpd: Fixes related to use of L2VPN/EVPN Add checks related to AFI_L2VPN/SAFI_EVPN that were missing in some parts of the code. Fix incorrect check skipping EVPN when sending End of RIB. Signed-off-by: Vivek Venkatraman --- bgpd/bgp_packet.c | 4 ++-- bgpd/bgpd.c | 6 ++++-- bgpd/bgpd.h | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index da6bf5c3cb..6f84a22588 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -247,8 +247,7 @@ bgp_write_packet (struct peer *peer) if (!(PAF_SUBGRP(paf))->t_coalesce && peer->afc_nego[afi][safi] && peer->synctime && ! CHECK_FLAG (peer->af_sflags[afi][safi], - PEER_STATUS_EOR_SEND) - && safi != SAFI_EVPN) + PEER_STATUS_EOR_SEND)) { SET_FLAG (peer->af_sflags[afi][safi], PEER_STATUS_EOR_SEND); @@ -1159,6 +1158,7 @@ bgp_open_receive (struct peer *peer, bgp_size_t size) peer->afc_nego[AFI_IP6][SAFI_UNICAST] = peer->afc[AFI_IP6][SAFI_UNICAST]; peer->afc_nego[AFI_IP6][SAFI_MULTICAST] = peer->afc[AFI_IP6][SAFI_MULTICAST]; peer->afc_nego[AFI_IP6][SAFI_LABELED_UNICAST] = peer->afc[AFI_IP6][SAFI_LABELED_UNICAST]; + peer->afc_nego[AFI_L2VPN][SAFI_EVPN] = peer->afc[AFI_L2VPN][SAFI_EVPN]; } /* When collision is detected and this peer is closed. Retrun diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 9d404b16dc..98ca4cf9d7 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -3642,7 +3642,8 @@ peer_active (struct peer *peer) || peer->afc[AFI_IP6][SAFI_MULTICAST] || peer->afc[AFI_IP6][SAFI_LABELED_UNICAST] || peer->afc[AFI_IP6][SAFI_MPLS_VPN] - || peer->afc[AFI_IP6][SAFI_ENCAP]) + || peer->afc[AFI_IP6][SAFI_ENCAP] + || peer->afc[AFI_L2VPN][SAFI_EVPN]) return 1; return 0; } @@ -3660,7 +3661,8 @@ peer_active_nego (struct peer *peer) || peer->afc_nego[AFI_IP6][SAFI_MULTICAST] || peer->afc_nego[AFI_IP6][SAFI_LABELED_UNICAST] || peer->afc_nego[AFI_IP6][SAFI_MPLS_VPN] - || peer->afc_nego[AFI_IP6][SAFI_ENCAP]) + || peer->afc_nego[AFI_IP6][SAFI_ENCAP] + || peer->afc_nego[AFI_L2VPN][SAFI_EVPN]) return 1; return 0; } diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 84dcb7e1d9..6c443fd650 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -1467,7 +1467,8 @@ peer_afi_active_nego (const struct peer *peer, afi_t afi) || peer->afc_nego[afi][SAFI_MULTICAST] || peer->afc_nego[afi][SAFI_LABELED_UNICAST] || peer->afc_nego[afi][SAFI_MPLS_VPN] - || peer->afc_nego[afi][SAFI_ENCAP]) + || peer->afc_nego[afi][SAFI_ENCAP] + || peer->afc_nego[afi][SAFI_EVPN]) return 1; return 0; } @@ -1487,7 +1488,8 @@ peer_group_af_configured (struct peer_group *group) || peer->afc[AFI_IP6][SAFI_MULTICAST] || peer->afc[AFI_IP6][SAFI_LABELED_UNICAST] || peer->afc[AFI_IP6][SAFI_MPLS_VPN] - || peer->afc[AFI_IP6][SAFI_ENCAP]) + || peer->afc[AFI_IP6][SAFI_ENCAP] + || peer->afc[AFI_IP6][SAFI_EVPN]) return 1; return 0; } -- 2.39.5