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 Mar 9, 2023
1 parent 937f274 commit dec02e9
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 @@ -2626,6 +2626,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 @@ -2653,6 +2654,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 dec02e9

Please sign in to comment.