From 637315fc78ce2a8bf64d725cffc72f29b266b325 Mon Sep 17 00:00:00 2001 From: Mitesh Kanjariya Date: Wed, 4 Apr 2018 13:01:45 -0700 Subject: [PATCH] bgpd: set NEXTHOP_UNCHANGED for l2vpn evpn by default for all BGP peers This flag needs to be set by default for l2vpn evpn address-family. We needed to find a place in the code which gets called by all peers at somepoint in the statemachine and before the routes are advertised. peer_new seems like the right place for this as we are setting other default af_flags here as well. Signed-off-by: Mitesh Kanjariya --- bgpd/bgpd.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index c6ad57f84a..36aa6b3c17 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -711,10 +711,6 @@ struct peer_af *peer_af_create(struct peer *peer, afi_t afi, safi_t safi) af->afid = afid; af->peer = peer; - /* for l2vpn/evpn the default behaviour is nexthop-unchanged */ - if (afi == AFI_L2VPN && safi == SAFI_EVPN) - peer_af_flag_set(peer, afi, safi, PEER_FLAG_NEXTHOP_UNCHANGED); - return af; } @@ -1178,6 +1174,11 @@ struct peer *peer_new(struct bgp *bgp) } peer->orf_plist[afi][safi] = NULL; } + + /* set nexthop-unchanged for l2vpn evpn by default */ + SET_FLAG(peer->af_flags[AFI_L2VPN][SAFI_EVPN], + PEER_FLAG_NEXTHOP_UNCHANGED); + SET_FLAG(peer->sflags, PEER_STATUS_CAPABILITY_OPEN); /* Create buffers. */ @@ -1932,10 +1933,6 @@ static int peer_activate_af(struct peer *peer, afi_t afi, safi_t safi) } } - /* for l2vpn/evpn the default behaviour is nexthop-unchanged */ - if (afi == AFI_L2VPN && safi == SAFI_EVPN) - peer_af_flag_set(peer, afi, safi, PEER_FLAG_NEXTHOP_UNCHANGED); - return 0; } -- 2.39.5