Skip to content

lib: Report IPv6 MTU and not IPv4 for if_update_state_mtu6#226

Open
mwinter-osr wants to merge 1 commit into
opensourcerouting:masterfrom
mwinter-osr:PR21501
Open

lib: Report IPv6 MTU and not IPv4 for if_update_state_mtu6#226
mwinter-osr wants to merge 1 commit into
opensourcerouting:masterfrom
mwinter-osr:PR21501

Conversation

@mwinter-osr
Copy link
Copy Markdown
Member

Original PR21501 by ton31337

Fixes: 80c6f98 ("lib: if: track oper-state inline")

Signed-off-by: Donatas Abraitis <[email protected]>
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 14, 2026

Greptile Summary

This is a one-line bug fix in lib/if.c correcting a copy-paste error in if_update_state_mtu6: the function was assigning the incoming mtu parameter to ifp->mtu6 correctly, but then passing ifp->mtu (the IPv4 MTU) instead of ifp->mtu6 (the IPv6 MTU) to nb_op_updatef for the operational-state notification. The fix is correct and mirrors the pattern used in the companion if_update_state_mtu function.

Confidence Score: 5/5

  • Safe to merge — trivial one-line copy-paste bug fix with no side effects.
  • The change is a single-variable correction (ifp->mtuifp->mtu6) that is obviously correct by inspection and consistent with the parallel if_update_state_mtu function. Existing mgmt_oper topotests cover the mtu6 operational-state field. No CLI changes, no user-visible behavioral change beyond reporting the correct IPv6 MTU value. No P0 or P1 findings.
  • No files require special attention.

Important Files Changed

Filename Overview
lib/if.c One-line bug fix: nb_op_updatef in if_update_state_mtu6 was passing ifp->mtu (IPv4) instead of ifp->mtu6 (IPv6) for the mtu6 operational-state notification. Fix is correct and consistent with if_update_state_mtu.

Sequence Diagram

sequenceDiagram
    participant Zebra as zebra/interface.c
    participant IfLib as lib/if.c
    participant NB as nb_op_updatef (MGMT)

    Zebra->>IfLib: if_update_state_mtu6(ifp, mtu)
    IfLib->>IfLib: "ifp->mtu6 = mtu"
    Note over IfLib: BEFORE: passed ifp->mtu (IPv4!)
    Note over IfLib: AFTER: passes ifp->mtu6 (IPv6 ✓)
    IfLib->>NB: "nb_op_updatef(state, "mtu6", "%u", ifp->mtu6)"
    NB-->>Zebra: operational state updated with correct IPv6 MTU
Loading

Reviews (1): Last reviewed commit: "lib: Report IPv6 MTU and not IPv4 for if..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants