]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: set NEXTHOP_UNCHANGED for l2vpn evpn by default for all BGP peers
authorMitesh Kanjariya <mitesh@hydra-01.mvlab.cumulusnetworks.com>
Wed, 4 Apr 2018 20:01:45 +0000 (13:01 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 8 May 2018 23:24:15 +0000 (19:24 -0400)
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 <mitesh@cumulusnetworks.com>
bgpd/bgpd.c

index c6ad57f84a9e6c71d978866089082d610a7b8754..36aa6b3c172c88f3ffcbfa48158d84aac0c070cf 100644 (file)
@@ -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;
 }