diff options
Diffstat (limited to 'bgpd/bgpd.c')
-rw-r--r-- | bgpd/bgpd.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index cf6c00ae5..1160066e8 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -1756,6 +1756,11 @@ non_peergroup_activate_af (struct peer *peer, afi_t afi, safi_t safi) return 1; } + /* Do not activate a peer for both SAFI_UNICAST and SAFI_LABELED_UNICAST */ + if ((safi == SAFI_UNICAST && peer->afc[afi][SAFI_LABELED_UNICAST]) || + (safi == SAFI_LABELED_UNICAST && peer->afc[afi][SAFI_UNICAST])) + return BGP_ERR_PEER_SAFI_CONFLICT; + /* Nothing to do if we've already activated this peer */ if (peer->afc[afi][safi]) return 0; @@ -1815,6 +1820,12 @@ peer_activate (struct peer *peer, afi_t afi, safi_t safi) * peer-group as well */ if (CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP)) { + + /* Do not activate a peer for both SAFI_UNICAST and SAFI_LABELED_UNICAST */ + if ((safi == SAFI_UNICAST && peer->afc[afi][SAFI_LABELED_UNICAST]) || + (safi == SAFI_LABELED_UNICAST && peer->afc[afi][SAFI_UNICAST])) + return BGP_ERR_PEER_SAFI_CONFLICT; + peer->afc[afi][safi] = 1; group = peer->group; |