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: fix wrong display of default vrf name #16695

Conversation

pguibert6WIND
Copy link
Member

The following output displays a ((null)) vrf:

rt2> show bgp ipv4 labeled-unicast prefix 172.16.1.1/32
BGP routing table entry for 172.16.1.1/32, version 2
Local label: 16
Paths: (1 available, best #1, table default, vrf (null))
Advertised to non peer-group peers:
172.16.1.1
[..]

Fix this by displaying the appropriate default vrf name when possible.

The following output displays a ((null)) vrf:

> rt2> show bgp ipv4 labeled-unicast prefix 172.16.1.1/32
> BGP routing table entry for 172.16.1.1/32, version 2
> Local label: 16
> Paths: (1 available, best FRRouting#1, table default, vrf (null))
>   Advertised to non peer-group peers:
>   172.16.1.1
> [..]

Fix this by displaying the appropriate default vrf name when possible.

Signed-off-by: Philippe Guibert <[email protected]>
@@ -12347,7 +12347,9 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
VRF_DEFAULT_NAME);
else
vty_out(vty, ", vrf %s",
bgp->name);
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)
Copy link
Member

Choose a reason for hiding this comment

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

This condition is useless, it's checked above, right? What I suggest is replacing these checks at all using bgp->name_pretty. In this case no need to check if it's a default instance and/or VRF/view instance.

@riw777 riw777 self-requested a review September 3, 2024 14:56
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