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

zebra: Don't display the vrf if not using namespace based vrfs #16750

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

donaldsharp
Copy link
Member

Currently when doing a show ip route table XXXX, zebra is displaying the current default vrf as the vrf we are in. We are displaying a table not a vrf. This is only true if you are not using namespace based vrf's, so modify the output to display accordingly.

@@ -942,11 +942,17 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,
if (!tableid)
vty_out(vty, "VRF %s:\n",
zvrf_name(zvrf));
else
vty_out(vty,
"VRF %s table %u:\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm - maybe I'm naive, but ... when I was poking around with this stuff, I thought it was nice that the vrf/table relationship was being displayed - it was just wrong sometimes. would it be bad to show the vrf each time?

Copy link
Member Author

Choose a reason for hiding this comment

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

tables have a dual nature in linux. It's a table and that table also can be a vrf. I don't think that it's a distinction that we should be making, though. If I have table 99 and it also is being used by vrf GREEN. I don't think when I say display table 99 that we should say it's vrf GREEN in that case, the operator didn't ask for that data. I don't think it makes sense in the l3mdev based vrf case that we should be displaying anything about a vrf when you display a specific table.

Copy link
Contributor

Choose a reason for hiding this comment

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

as I say, maybe I'm being naive - but aren't there just two possibilities? either a table is in the default vrf, or it's in a different vrf. why not show that association? we're willing to show the vrf and table in the output of show vrf, and that seems ... fine. why not here too?

Copy link
Member

@Jafaral Jafaral Sep 5, 2024

Choose a reason for hiding this comment

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

I kinda like the fact that if the table happens to be a vrf, then show me that info too.

Copy link
Member

Choose a reason for hiding this comment

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

It is an important piece of info. I am with @mjstapp here, I think we should keep it.

Copy link
Member Author

Choose a reason for hiding this comment

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

it doesn't do that Jafar. If using l3mdev it always displays Default. My point is that default is nonsensical. The fact that we are asking about a table means that we are not talking about vrfs at all. In linux they just happen to have taken the l3mdev device and overlayed it over the table id space. But table 3939 is not in the default vrf, as that it has no relation to the default vrf at all, hence my removal

Copy link
Contributor

Choose a reason for hiding this comment

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

gosh - we seem to be crossed-up here.
none of us thinks it's correct to print "default vrf" when ... it's not - but it would be nice to print the correct vrf, whether default or not (imo).

Copy link
Member Author

Choose a reason for hiding this comment

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

I disagree, the operator has asked for a table not a vrf in this case. Don't display anything about a vrf then

Copy link
Member

Choose a reason for hiding this comment

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

dropping default, and keeping the correct vrf when there is actually one is the right approach IMO.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@donaldsharp donaldsharp force-pushed the table_display_is_not_vrf_based_in_some_cases branch from 619d5d6 to bd6c179 Compare September 25, 2024 18:28
@github-actions github-actions bot added size/M and removed size/S labels Sep 25, 2024
@@ -398,6 +398,8 @@ vrf_id_t zebra_vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id)

RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
zvrf = vrf->info;

zlog_debug("Looking at %s for table_id", zvrf_name(zvrf));
Copy link
Contributor

Choose a reason for hiding this comment

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

whoops - debugs?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@donaldsharp donaldsharp force-pushed the table_display_is_not_vrf_based_in_some_cases branch 2 times, most recently from c368d77 to 53b1243 Compare September 25, 2024 20:07
@donaldsharp
Copy link
Member Author

Fixed

Currently when doing a `show ip route table XXXX`, zebra is displaying
the current default vrf as the vrf we are in.  We are displaying a
table not a vrf.  This is only true if you are not using namespace
based vrf's, so modify the output to display accordingly.

Signed-off-by: Donald Sharp <[email protected]>
@donaldsharp donaldsharp force-pushed the table_display_is_not_vrf_based_in_some_cases branch from 53b1243 to e700638 Compare October 10, 2024 14:17
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.

3 participants