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: Validate imported routes next-hop that is in a default VRF #16748

Merged
merged 4 commits into from
Sep 10, 2024

Conversation

ton31337
Copy link
Member

@ton31337 ton31337 commented Sep 5, 2024

No description provided.

Without this patch:

```
r1# sh ip bgp vrf CUSTOMER-A
BGP table version is 1, local router ID is 20.20.20.0, vrf id 4
Default local pref 100, local AS 65000
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
     192.168.2.0/24   192.168.179.5@0<
                                             0             0 479 ?

Displayed 1 routes and 1 total paths
r1#
```

This is because the route is imported, next-hop is in a default VRF, and we should
evaluate an ultimate path info, not the current path info.

After:

```
r1# sh ip bgp vrf CUSTOMER-A
BGP table version is 1, local router ID is 20.20.20.0, vrf id 4
Default local pref 100, local AS 65000
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.2.0/24   192.168.179.5@0<
                                             0             0 479 ?

Displayed 1 routes and 1 total paths
r1#
```

In both cases next-hop in cache table is valid:

```
r1# sh ip bgp nexthop
Current BGP nexthop cache:
 192.168.179.5 valid [IGP metric 0], #paths 2, peer 192.168.179.5
  Resolved prefix 192.168.179.0/24
  if r1-eth0
  Last update: Thu Sep  5 11:24:37 2024
r1#
```

Signed-off-by: Donatas Abraitis <[email protected]>
@frrbot frrbot bot added bgp tests Topotests, make check, etc labels Sep 5, 2024
They are expected in router_vrf_json_cmp_exact_filter(), because it has
exact=True.

Signed-off-by: Donatas Abraitis <[email protected]>
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 riw777 merged commit f48b052 into FRRouting:master Sep 10, 2024
11 checks passed
@ton31337 ton31337 deleted the fix/issue_12502 branch September 10, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bgp master size/L tests Topotests, make check, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants