-
Notifications
You must be signed in to change notification settings - Fork 1.4k
zebra: fix nexthop rib out for duplicate nhg #19015
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The duplicate nexthop is not displayed with
proper alignment.
mlx-4700-44# show nexthop-group rib 580
ID: 580 (zebra)
RefCnt: 1
Uptime: 01:39:06
VRF: default
Valid, Installed
Depends: (530) (564) (579)
via 20.1.1.9 (vrf default) (recursive), weight 1
via 20.1.1.2, swp1s0 (vrf default), weight 1
via 30.1.2.9 (vrf default) (recursive), weight 1
via 30.1.1.2, br_default.60 (vrf default), weight 1
via 30.1.1.6, vlan70 (vrf default), weight 1
via 30.1.1.10, bond1 (vrf default), weight 1
via 20.1.1.2, swp1s0 (vrf default), weight 1 <<<<<<<<
Ticket: #4496048
With fix:
mlx-4700-44# show nexthop-group rib 580
ID: 580 (zebra)
RefCnt: 1
Uptime: 01:39:06
VRF: default
Valid, Installed
Depends: (530) (564) (579)
via 20.1.1.9 (vrf default) (recursive), weight 1
via 20.1.1.2, swp1s0 (vrf default), weight 1
via 30.1.2.9 (vrf default) (recursive), weight 1
via 30.1.1.2, br_default.60 (vrf default), weight 1
via 30.1.1.6, vlan70 (vrf default), weight 1
via 30.1.1.10, bond1 (vrf default), weight 1
via 20.1.1.2, swp1s0 (vrf default), weight 1
mlx-4700-44# show nexthop-group rib 530
ID: 530 (zebra)
RefCnt: 17
Uptime: 02:02:52
VRF: default
Valid, Installed
Interface Index: 38
via 20.1.1.2, swp1s0 (vrf default), weight 1
Dependents: (576) (579) (580) (582)
show nexthop-group rib 580 json
"580":{
"type":"zebra",
"refCount":1,
"uptime":"02:01:33",
"vrf":"default",
"nhGrpUptimeEstablishedEpoch":1749708524,
"valid":true,
"installed":true,
"depends":[
530,
564,
579
],
"nexthops":[
{
"flags":5,
"ip":"20.1.1.9",
"afi":"ipv4",
"vrf":"default",
"active":true,
"recursive":true,
"weight":1
},
{
"flags":3,
"fib":true,
"ip":"20.1.1.2",
"afi":"ipv4",
"interfaceIndex":38,
"interfaceName":"swp1s0",
"vrf":"default",
"resolver":true,
"active":true,
"weight":1
},
{
"flags":19,
"duplicate":true, <<<<
"fib":true,
"ip":"20.1.1.2",
"afi":"ipv4",
"interfaceIndex":38,
"interfaceName":"swp1s0",
"vrf":"default",
"active":true,
"weight":1
}
]
}
Signed-off-by: Chirag Shah <[email protected]>
Member
|
what's the output of |
Member
Author
|
riw777
approved these changes
Jun 17, 2025
Member
riw777
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
Member
|
LGTM |
raja-rajasekar
pushed a commit
to raja-rajasekar/frr
that referenced
this pull request
Jul 21, 2025
zebra: fix nexthop rib out for duplicate nhg
### **User description**
The duplicate nexthop is not dispalyed with
proper alignment.
```
mlx-4700-44# show nexthop-group rib 580
ID: 580 (zebra)
RefCnt: 1
Uptime: 01:39:06
VRF: default
Valid, Installed
Depends: (530) (564) (579)
via 20.1.1.9 (vrf default) (recursive), weight 1
via 20.1.1.2, swp1s0 (vrf default), weight 1
via 30.1.2.9 (vrf default) (recursive), weight 1
via 30.1.1.2, br_default.60 (vrf default), weight 1
via 30.1.1.6, vlan70 (vrf default), weight 1
via 30.1.1.10, bond1 (vrf default), weight 1
via 20.1.1.2, swp1s0 (vrf default), weight 1 <<<<<<<<
```
Ticket: #4496048
With fix:
```
mlx-4700-44# show nexthop-group rib 580
ID: 580 (zebra)
RefCnt: 1
Uptime: 01:39:06
VRF: default
Valid, Installed
Depends: (530) (564) (579)
via 20.1.1.9 (vrf default) (recursive), weight 1
via 20.1.1.2, swp1s0 (vrf default), weight 1
via 30.1.2.9 (vrf default) (recursive), weight 1
via 30.1.1.2, br_default.60 (vrf default), weight 1
via 30.1.1.6, vlan70 (vrf default), weight 1
via 30.1.1.10, bond1 (vrf default), weight 1
via 20.1.1.2, swp1s0 (vrf default), weight 1
mlx-4700-44# show nexthop-group rib 530
ID: 530 (zebra)
RefCnt: 17
Uptime: 02:02:52
VRF: default
Valid, Installed
Interface Index: 38
via 20.1.1.2, swp1s0 (vrf default), weight 1
Dependents: (576) (579) (580) (582)
show nexthop-group rib 580 json
"580":{
"type":"zebra",
"refCount":1,
"uptime":"02:01:33",
"vrf":"default",
"nhGrpUptimeEstablishedEpoch":1749708524,
"valid":true,
"installed":true,
"depends":[
530,
564,
579
],
"nexthops":[
{
"flags":5,
"ip":"20.1.1.9",
"afi":"ipv4",
"vrf":"default",
"active":true,
"recursive":true,
"weight":1
},
{
"flags":3,
"fib":true,
"ip":"20.1.1.2",
"afi":"ipv4",
"interfaceIndex":38,
"interfaceName":"swp1s0",
"vrf":"default",
"resolver":true,
"active":true,
"weight":1
},
{
"flags":19,
"duplicate":true, <<<<
"fib":true,
"ip":"20.1.1.2",
"afi":"ipv4",
"interfaceIndex":38,
"interfaceName":"swp1s0",
"vrf":"default",
"active":true,
"weight":1
}
]
}
```
Upstream PR FRRouting#19015
Signed-off-by: Chirag Shah <[email protected]>
___
### **PR Type**
Bug fix
___
### **Description**
- Fix alignment of duplicate nexthops in CLI output
___
### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>zebra_vty.c</strong><dd><code>Fix CLI display alignment for duplicate nexthops</code> </dd></summary>
<hr>
zebra/zebra_vty.c
<li>Added check for NEXTHOP_FLAG_DUPLICATE when determining indentation<br> <li> Applied consistent indentation logic for both regular and backup <br>nexthops<br> <li> Fixed alignment issue where duplicate nexthops were incorrectly <br>indented
</details>
</td>
<td><a href="https://gitlab-master.nvidia.com/nbu-sws/CL/FRR/frr/-/blob/chirag/clfrrdev4/zebra/zebra_vty.c?ref_type=heads">+8/-8</a> </td>
</tr>
</table></td></tr></tr></tbody></table>
___
<details><summary>Need help?</summary>- Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.<br>- Check out the <a href='https://qodo-merge-docs.qodo.ai/usage-guide/'>documentation</a> for more information.</details>
#
See merge request nbu-sws/CL/FRR/frr!1160
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The duplicate nexthop is not displayed with proper alignment.
With fix:
Signed-off-by: Chirag Shah <[email protected]