Skip to content

Commit

Permalink
bgpd: Ensure correct flags when inheriting config from a peer group
Browse files Browse the repository at this point in the history
When a peer is a peer-group based peer, and the config is inherited
from the peer group, let's ensure that the CONFIG_NODE flag stays
no matter what.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
  • Loading branch information
donaldsharp committed Dec 5, 2022
1 parent 69ef3f3 commit b8579ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2649,6 +2649,7 @@ static void peer_group2peer_config_copy(struct peer_group *group,
{
uint32_t flags_tmp;
struct peer *conf;
bool config_node = !!CHECK_FLAG(peer->flags, PEER_FLAG_CONFIG_NODE);

conf = group->conf;

Expand Down Expand Up @@ -2676,6 +2677,9 @@ static void peer_group2peer_config_copy(struct peer_group *group,
SET_FLAG(peer->flags, flags_tmp);
SET_FLAG(peer->flags_invert, conf->flags_invert);

if (config_node)
SET_FLAG(peer->flags, PEER_FLAG_CONFIG_NODE);

/* peer timers apply */
if (!CHECK_FLAG(peer->flags_override, PEER_FLAG_TIMER)) {
PEER_ATTR_INHERIT(peer, group, holdtime);
Expand Down

0 comments on commit b8579ee

Please sign in to comment.