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

nhrpd: fix show ip nhrp output #16700

Merged
merged 2 commits into from
Nov 28, 2024
Merged

Conversation

louis-6wind
Copy link
Contributor

See individual commits

nhrpd/nhrp_vty.c Outdated
@@ -1023,9 +1023,7 @@ DEFUN(show_ip_nhrp, show_ip_nhrp_cmd,
} else if (argv[3]->text[0] == 's') {
nhrp_shortcut_foreach(ctx.afi, show_ip_nhrp_shortcut, &ctx);
} else {
if (!ctx.json)
vty_out(vty, "Status: ok\n\n");
Copy link
Member

Choose a reason for hiding this comment

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

So, this is nonsense at all (writing this status as OK) if I understand it correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. It is nonsense to always write it as OK.

@donaldsharp
Copy link
Member

why dont we just drop the third commit. i fail to see a reason to change the output unless its right

@louis-6wind
Copy link
Contributor Author

why dont we just drop the third commit. i fail to see a reason to change the output unless its right

The problem is that we are always displaying "status: OK" even if shortcut failed

"show ip nhrp opennhrp json" counter is incorrect.

> root@nhs1:/# vtysh -c 'sh ip nhrp opennhrp json' | jq .
> {
>   "attr": {
>     "status": "ok",
>     "entriesCount": 1 <=== NOK
>   },
>   "table": [
>     {
>       "type": "dynamic",
>       "up": true,
>       "used": false,
>       "protocolAddress": "172.16.1.4",
>       "protocolAddressSize": 32,
>       "nbmaAddress": "192.168.2.4"
>     },
>     {
>       "type": "dynamic",
>       "up": true,
>       "used": false,
>       "protocolAddress": "172.16.1.5",
>       "protocolAddressSize": 32,
>       "nbmaAddress": "192.168.2.5"
>     }
>   ]
> }
>

Fixes: 87b9e98 ("nhrpd: add json support to show nhrp vty commands")
Signed-off-by: Louis Scalbert <[email protected]>
The command outputs too much "\n". Normalize it.

Signed-off-by: Louis Scalbert <[email protected]>
@louis-6wind
Copy link
Contributor Author

ci:rerun

@ton31337 ton31337 merged commit 8e1231d into FRRouting:master Nov 28, 2024
11 checks passed
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