Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: do not accept a host route that matches a local address #17976

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

enkechen-panw
Copy link
Contributor

Accepting a host route from a BGP peer for a local address would result in inconsistency between BGP and RIB/FIB.

Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test please.

@frrbot frrbot bot added the tests Topotests, make check, etc label Feb 2, 2025
@enkechen-panw
Copy link
Contributor Author

enkechen-panw commented Feb 3, 2025

A test please.

It's covered by topotest/bgp_l3vpn_to_bgp_direct (with the adjustment). Is that ok?

Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@riw777
Copy link
Member

riw777 commented Feb 4, 2025

waiting on freeze

bgpd/bgp_route.c Outdated Show resolved Hide resolved
@donaldsharp
Copy link
Member

One thing that concerns me is that there is no recovery mechanism in place for when the host interface is removed and all of a sudden we have no route to the host anymore in the bgp rib.

@ton31337
Copy link
Member

ton31337 commented Feb 4, 2025

Also, how does it work if running a route-server mode (= transparent)? We should relax this also?

@enkechen-panw
Copy link
Contributor Author

enkechen-panw commented Feb 4, 2025

One thing that concerns me is that there is no recovery mechanism in place for when the host interface is removed and all of a sudden we have no route to the host anymore in the bgp rib.

The same issue exists with bgp_nexthop_self() check. Not sure how much we want to do in the code for auto recovery from such a misconfig, i.e., one address assigned to multiple devices.

@enkechen-panw
Copy link
Contributor Author

enkechen-panw commented Feb 4, 2025

Also, how does it work if running a route-server mode (= transparent)? We should relax this also?

It's the same, isn't? If the RS accepts a host route for its own address, the host route may be advertised with a third-party nexthop. That would not be correct.

Accepting a host route from a BGP peer for a local address would
result in inconsistency between BGP and RIB/FIB.

Signed-off-by: Enke Chen <[email protected]>
Adjsut topotest/bgp_l3vpn_to_bgp_direct post the patch that
rejects host routes for the local addresses from BGP peers.

Signed-off-by: Enke Chen <[email protected]>
@enkechen-panw
Copy link
Contributor Author

ci:rerun

1 similar comment
@enkechen-panw
Copy link
Contributor Author

ci:rerun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bgp master size/S tests Topotests, make check, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants