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

*: fix 'show nexthop-group rib' displays invalid VRF #15084

Closed
wants to merge 1 commit into from

Conversation

pguibert6WIND
Copy link
Member

When configuring a VRF route with a nexthop group, the nexthop group displays a wrong VRF:

ubuntu2204(config)# nexthop-group A
ubuntu2204(config-nh-group)# nexthop 172.31.0.100
ubuntu2204(config-nh-group)# end
ubuntu2204# sharp install routes vrf vrf3 2.2.2.0 nexthop-group A 1
ubuntu2204# show ip route vrf vrf3 nexthop-group
[..]
D>* 2.2.2.0/32 [150/0] (633) via 172.31.0.100, loop3 (vrf default), weight 1, 00:00:07
ubuntu2204# show nexthop-group rib 633
[..]
VRF: default
[..]

Fix this by using the vrf_id of the route that uses the nexthop-group. Also, when NHG_ADD is used, the zapi_nhg structure hosts the vrf_id value.

The displayed VRF value is only a consistency change, and does not prevent an user to attach two different routes from different VRFs with the same NHG. It is up to the CP daemon to ensure routes are using the appropriate NHG.

Fixes: df9069c ("zebra: Add some more output to show nexthop-group")

When configuring a VRF route with a nexthop group, the
nexthop group displays a wrong VRF:
> ubuntu2204(config)# nexthop-group A
> ubuntu2204(config-nh-group)# nexthop 172.31.0.100
> ubuntu2204(config-nh-group)# end
> ubuntu2204# sharp install routes vrf vrf3 2.2.2.0 nexthop-group A 1
> ubuntu2204# show ip route vrf vrf3 nexthop-group
> [..]
> D>* 2.2.2.0/32 [150/0] (633) via 172.31.0.100, loop3 (vrf default), weight 1, 00:00:07
> ubuntu2204# show nexthop-group rib 633
> [..]
>      VRF: default
> [..]

Fix this by using the vrf_id of the route that uses the
nexthop-group. Also, when NHG_ADD is used, the zapi_nhg
structure hosts the vrf_id value.

The displayed VRF value is only a consistency change, and
does not prevent an user to attach two different routes
from different VRFs with the same NHG. It is up to the
CP daemon to ensure routes are using the appropriate
NHG.

Fixes: df9069c ("zebra: Add some more output to show nexthop-group")
Signed-off-by: Philippe Guibert <[email protected]>
@donaldsharp
Copy link
Member

I disagree that this is a bug:

nexthop-group A
 nexthop 1.2.3.4 nexthop-vrf GREEN
exit
!

if you want the nexthop to be in a different vrf you must specify it.

@donaldsharp
Copy link
Member

With this change I can now no longer have nexthops into multiple vrfs using the nexthop-group syntax and the nexthops are forced to be in the vrf that the route is being installed into.

@pguibert6WIND
Copy link
Member Author

With this change I can now no longer have nexthops into multiple vrfs using the nexthop-group syntax and the nexthops are forced to be in the vrf that the route is being installed into.

does that mean that nhe->vrf_id can be suppressed?

@pguibert6WIND
Copy link
Member Author

closing this ticket.
I consider the VRF information as irrelevant if FRR is run in vrflite mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants