Conversation
The ietf-interfaces leaf-lists higher-layer-if and lower-layer-if were never populated, so operational data gave no general view of how interfaces stack. Only the VLAN augment carried its lower-layer-if. The kernel already keeps this adjacency in sysfs, as upper_<name> and lower_<name> links in each interface directory. Read them per interface and drop references to interfaces hidden from operational (group internal, CAN) so no leafref points at a missing entry. Part of issue #514. Signed-off-by: Joachim Wiberg <[email protected]>
The mDNS neighbor code has a private formatter for YANG date-and-time strings. More operational leaves need the same encoding, so give it a home in shared.c and let callers pass the time to format. Signed-off-by: Joachim Wiberg <[email protected]>
The ietf-interfaces leaf last-change, the time an interface entered its current operational state, was missing. Nothing on the system keeps it: the kernel has no ifLastChange and statd only reads state on demand. Track it in statd. A netlink socket in the RTMGRP_LINK group feeds an in-memory map keyed by interface name, stamping every operational state change with the monotonic clock. The interfaces callback adds the leaf to yanger's output for each interface with a recorded change, converting to wall-clock time at that point so a later NTP step does not skew old stamps. Interfaces whose state predates statd get no last-change, as RFC 8343 requires. Part of issue #514. Signed-off-by: Joachim Wiberg <[email protected]>
The interface detail page lists a fixed set of status fields, so the new ietf-interfaces leaves did not show up. Add last change with its age, and the lower and higher layer interfaces linked to their own pages. Signed-off-by: Joachim Wiberg <[email protected]>
mattiaswal
approved these changes
Sep 17, 2026
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
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.
Description
Completes #514 with the remaining ietf-interfaces.yang status leaves. Both CLI and WebUI support.
upper_/lower_ links in sysfs, covering bridge ports, LAG
members, VLAN parents and any other netdev adjacency.
map keyed by interface name. Interfaces whose state predates
statd have no last-change, per RFC 8343.
show interface <name>prints last change and the layer lists.Note
As per RFC8343, the
last-changenode is not shown (included) "If the current state was entered prior to the last re-initialization of the local network management subsystem". I.e., on startup.Checklist
Tick relevant boxes, this PR is-a or has-a: