Skip to content

zebra: rename BondState to State in 'show evpn es' output - #20721

Merged
riw777 merged 1 commit into
FRRouting:masterfrom
shashanka-ks:zebra_evpn_es_state_rename
Feb 10, 2026
Merged

zebra: rename BondState to State in 'show evpn es' output#20721
riw777 merged 1 commit into
FRRouting:masterfrom
shashanka-ks:zebra_evpn_es_state_rename

Conversation

@shashanka-ks

Copy link
Copy Markdown
Contributor

This is a follow-up to PR #20711 which added the State column to 'show evpn es' output.

Rename the column/field name from 'BondState' to 'State' for consistency with other FRR CLI commands that use 'State' to define an entity's current operational state.

The following CLIs already use 'State' as the column name:

  • show vrf [NAME|all] vni [json]: VRF, VNI, VxLAN IF, L3-SVI, State, Rmac
  • show ip neigh: Neighbor, Type, Flags, State, MAC, Remote ES/VTEP, Seq #'s
  • show evpn arp-cache vni [json]: same header as above
  • show evpn arp-cache vni all [json]: same header
  • show evpn arp-cache vni duplicate [json]: IP, Type, State, MAC, ...

Using consistent naming simplifies user parsing via object model - 'state' is easier than having 'bondState', 'vniState', etc.

Changes:

  • Rename column header from 'BondState' to 'State'
  • Rename JSON field from 'bondState' to 'state'
  • Adjust format width from %-9s to %-5s to match column name length

Before (PR #20711):
ESI Type ES-IF BondState VTEPs
03:44:38:39:ff:ff:01:00:00:01 LRN hostbond_1 down ...

After:
ESI Type ES-IF State VTEPs
03:44:38:39:ff:ff:01:00:00:01 LRN hostbond_1 down ...

Rename the column/field name from 'BondState' to 'State' for consistency
with other FRR CLI commands that use 'State' to define an entity's
current operational state.

The following CLIs already use 'State' as the column name:
- show vrf [NAME|all] vni [json]: VRF, VNI, VxLAN IF, L3-SVI, State, Rmac
- show ip neigh: Neighbor, Type, Flags, State, MAC, Remote ES/VTEP, Seq #'s
- show evpn arp-cache vni <vni> [json]: same header as above
- show evpn arp-cache vni all [json]: same header
- show evpn arp-cache vni <vni> duplicate [json]: IP, Type, State, MAC, ...

Using consistent naming simplifies user parsing via object model - 'state'
is easier than having 'bondState', 'vniState', etc.

Changes:
- Rename column header from 'BondState' to 'State'
- Rename JSON field from 'bondState' to 'state'
- Adjust format width from %-9s to %-5s to match column name length

Before (PR FRRouting#20711):
ESI                            Type ES-IF                 BondState VTEPs
03:44:38:39:ff:ff:01:00:00:01  LRN  hostbond_1            down      ...

After:
ESI                            Type ES-IF                 State VTEPs
03:44:38:39:ff:ff:01:00:00:01  LRN  hostbond_1            down  ...

Signed-off-by: Shashanka K S <shashankaks@nvidia.com>
@greptile-apps

greptile-apps Bot commented Feb 7, 2026

Copy link
Copy Markdown

Greptile Overview

Greptile Summary

Renamed the column header from BondState to State in the show evpn es command output for consistency with other FRR CLI commands.

Changes made:

  • JSON field renamed from bondState to state in zebra_evpn_es_show_entry()
  • Column header renamed from BondState to State in zebra_evpn_es_show()
  • Format width adjusted from %-9s to %-5s to match the new column name length

The changes align with the naming conventions used in other FRR commands like show vrf vni, which already use State as the column name. This improves consistency across the CLI interface.

Confidence Score: 5/5

  • This PR is safe to merge with no concerns
  • Simple cosmetic changes that rename a column header and JSON field for consistency. The changes are minimal (3 lines), well-tested from previous PR, and improve naming consistency across the CLI. No functional logic changes, no security concerns, and aligns with established patterns in the codebase.
  • No files require special attention

Important Files Changed

Filename Overview
zebra/zebra_evpn_mh.c Renamed column header from BondState to State and adjusted format width from %-9s to %-5s for consistency

Sequence Diagram

sequenceDiagram
    participant User
    participant VTY as VTY (CLI)
    participant EVPN as zebra_evpn_es_show()
    participant Entry as zebra_evpn_es_show_entry()
    participant Output as vty_out/json
    
    User->>VTY: show evpn es [json]
    VTY->>EVPN: zebra_evpn_es_show(vty, uj)
    
    alt JSON output
        EVPN->>Output: Create json_array
    else Plain text output
        EVPN->>Output: Print header with "State" column (%-5s width)
        Note over Output: Header: ESI, Type, ES-IF, State, VTEPs
    end
    
    loop For each ES entry
        EVPN->>Entry: zebra_evpn_es_show_entry(vty, es, json_array)
        
        alt JSON output
            Entry->>Output: Add "state" field (up/down/-)
            Note over Output: JSON field: "state": "up"|"down"
        else Plain text output
            Entry->>Output: Format with %-5s for state column
            Note over Output: State shown as "up", "down", or "-"
        end
    end
    
    alt JSON output
        EVPN->>Output: vty_json(json_array)
    end
    
    Output->>User: Display formatted output
Loading

Comment thread zebra/zebra_evpn_mh.c
/* Add bond state field for local ES */
if (es->flags & ZEBRA_EVPNES_LOCAL)
json_object_string_add(json, "bondState",
json_object_string_add(json, "state",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a breaking change, please put it under CONFDATE (6 months minimum) and add this as an additional field.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @ton31337, I introduced the bondState field myself in PR #20711 just 2 days ago, and it hasn't been included in any release yet. Since it's brand new with no users depending on it, I'd like to fix the naming now for consistency before it gets adopted.

@riw777 riw777 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good

@riw777
riw777 merged commit 6cabc9c into FRRouting:master Feb 10, 2026
23 checks passed
@shashanka-ks
shashanka-ks deleted the zebra_evpn_es_state_rename branch February 11, 2026 04:32
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