bgpd: honor 'no activate' for dynamic neighbors in peer-group - #21658
Conversation
Greptile SummaryThis PR fixes a bug where dynamic peers (created via Confidence Score: 5/5This PR is safe to merge β the change is minimal, correct, and directly mirrors an existing proven fix in peer_group_bind(). The fix is a 4-line addition that replicates the exact same No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant TCP as Incoming TCP
participant BGP as bgpd
participant PCBDN as peer_create_bind_dynamic_neighbor()
participant PC as peer_create()
participant PD as peer_deactivate()
TCP->>BGP: Dynamic peer connects (bgp listen range)
BGP->>PCBDN: peer_create_bind_dynamic_neighbor(bgp, su, group)
PCBDN->>PC: peer_create(...) β activates IPv4 unicast by default
PC-->>PCBDN: peer (with afc[AFI_IP][SAFI_UNICAST]=1)
PCBDN->>PCBDN: peer_group2peer_config_copy(group, peer)
loop FOREACH_AFI_SAFI
alt group->conf->afc[afi][safi] == 0 (group has disabled this AF)
Note over PCBDN,PD: NEW: deactivate the AF the group does not want
PCBDN->>PD: peer_deactivate(peer, afi, safi)
PD->>PD: non_peergroup_deactivate_af() sets afc=0, deletes peer_af
else group->conf->afc[afi][safi] == 1 (group has enabled this AF)
PCBDN->>PCBDN: peer->afc[afi][safi] = 1, peer_af_create(), peer_group2peer_config_copy_af()
end
end
PCBDN-->>BGP: peer (AFs match group exactly)
Reviews (1): Last reviewed commit: "bgpd: honor 'no activate' for dynamic ne..." | Re-trigger Greptile |
a650c6c to
6656e47
Compare
When a dynamic peer connects via 'bgp listen range', peer_create() activates IPv4 unicast by default. peer_create_bind_dynamic_neighbor() then applies the group's AF config but only activates AFIs the group has enabled -- it never deactivates AFIs the group has disabled. This causes 'no neighbor <group> activate' under an address-family to be ignored for dynamic peers. Add peer_deactivate() for AFIs the group has deactivated, matching the fix in peer_group_bind() from commit 5f00745 ("bgpd: peer-group members 'activate' when they shouldn't"). Signed-off-by: Eyal Nissim <enissim@nvidia.com>
6656e47 to
48aa37f
Compare
|
@Mergifyio backport stable/10.6 stable/10.5 stable/10.4 |
β Backports have been createdDetails
|
bgpd: honor 'no activate' for dynamic neighbors in peer-group (backport #21658)
bgpd: honor 'no activate' for dynamic neighbors in peer-group (backport #21658)
bgpd: honor 'no activate' for dynamic neighbors in peer-group (backport #21658)
When a dynamic peer connects via 'bgp listen range', peer_create() activates IPv4 unicast by default. peer_create_bind_dynamic_neighbor() then applies the group's AF config but only activates AFIs the group has enabled -- it never deactivates AFIs the group has disabled. This causes 'no neighbor activate' under an address-family to be ignored for dynamic peers.
Add peer_deactivate() for AFIs the group has deactivated, matching the fix in peer_group_bind() from commit 5f00745 ("bgpd: peer-group members 'activate' when they shouldn't").