bgpd: Don't mark nexthop as changed if a set next-hop unchanged is applied - #21445
Merged
riw777 merged 2 commits intoApr 14, 2026
Merged
Conversation
ton31337
force-pushed
the
fix/bgp_nexthop_unchanged_outbound
branch
from
April 1, 2026 19:41
f544e6f to
2cca7b9
Compare
Greptile SummaryThis PR fixes a bug in
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Peer_In as Inbound Peer
participant BGP as BGP (route store)
participant RM_In as Inbound Route-Map
participant RM_Out as Outbound Route-Map
participant Peer_Out as Outbound Peer
Peer_In->>BGP: Receive prefix
BGP->>RM_In: Apply inbound route-map
Note over RM_In: "set next-hop unchanged"<br/>sets BATTR_RMAP_NEXTHOP_UNCHANGED<br/>in piattr->rmap_change_flags
BGP->>RM_Out: Apply outbound route-map (subgroup_announce_check)
RM_Out->>RM_Out: bgp_rmap_nhop_changed(attr->rmap_change_flags)
Note over RM_Out: OLD: also checked piattr->rmap_change_flags<br/>β incorrectly saw BATTR_RMAP_NEXTHOP_UNCHANGED<br/>β skipped nexthop reset<br/><br/>NEW: only checks attr->rmap_change_flags<br/>β inbound flag has no effect<br/>β nexthop reset proceeds normally
RM_Out->>Peer_Out: Announce with correct nexthop
Reviews (1): Last reviewed commit: "bgpd: Don't mark nexthop as changed if a..." | Re-trigger Greptile |
Contributor
|
LGTM. |
riw777
reviewed
Apr 2, 2026
riw777
left a comment
Member
There was a problem hiding this comment.
looks good ... are there any topo test changes for this? I wouldn't think so, but thought I'd ask before pushing.
β¦plied An inbound policy preserving the received nexthop into the RIB shouldn't prevent the outbound decision to set next-hop-self or reset the nexthop for EBGP. Those are independent decisions. If an operator wants the nexthop preserved on outbound, they configure neighbor X next-hop-unchanged or an outbound route-map with set ip next-hop unchanged (which would set the flag in out_rmap_flags). Fixes: a725bf4 ("bgpd:Fixing a conflict issue between rmap_in_change_flag and rmap_out_change_flag.") Signed-off-by: Martin Winter <mwinter@opensourcerouting.org> Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
β¦ outgoing Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
ton31337
force-pushed
the
fix/bgp_nexthop_unchanged_outbound
branch
from
April 7, 2026 13:13
2cca7b9 to
8de3f04
Compare
Member
Author
@riw777, added. |
Member
Author
|
@Mergifyio backport stable/10.6 stable/10.5 stable/10.4 stable/10.3 stable/10.2 |
β Backports have been createdDetails
|
riw777
approved these changes
Apr 14, 2026
This was referenced Apr 14, 2026
Merged
Merged
Merged
Merged
donaldsharp
added a commit
that referenced
this pull request
Apr 14, 2026
bgpd: Don't mark nexthop as changed if a set next-hop unchanged is applied (backport #21445)
donaldsharp
added a commit
that referenced
this pull request
Apr 14, 2026
bgpd: Don't mark nexthop as changed if a set next-hop unchanged is applied (backport #21445)
donaldsharp
added a commit
that referenced
this pull request
Apr 14, 2026
bgpd: Don't mark nexthop as changed if a set next-hop unchanged is applied (backport #21445)
donaldsharp
added a commit
that referenced
this pull request
Apr 15, 2026
bgpd: Don't mark nexthop as changed if a set next-hop unchanged is applied (backport #21445)
donaldsharp
added a commit
that referenced
this pull request
Apr 16, 2026
bgpd: Don't mark nexthop as changed if a set next-hop unchanged is applied (backport #21445)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.