Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net/hsr: add protocol version to fill_info output

Currently, it is possible to configure IFLA_HSR_VERSION, but
there is no way to check in userspace what the currently
configured HSR protocol version is.

Add it to the output of hsr_fill_info(), when the interface
is using the HSR protocol. Let's not expose it when using
the PRP protocol, since it only has one version and it's
not possible to set it from userspace.

This info could then be used by e.g. ip(8), like so:
$ ip -d link show hsr0
12: hsr0: <BROADCAST,MULTICAST> mtu ...
...
hsr slave1 veth0 slave2 veth1 ... proto 0 version 1
Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Jan Vaclav <jvaclav@redhat.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20251009210903.1055187-6-jvaclav@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Jan Vaclav and committed by
Paolo Abeni
16a22063 53615ad2

+2
+2
net/hsr/hsr_netlink.c
··· 166 166 goto nla_put_failure; 167 167 if (hsr->prot_version == PRP_V1) 168 168 proto = HSR_PROTOCOL_PRP; 169 + else if (nla_put_u8(skb, IFLA_HSR_VERSION, hsr->prot_version)) 170 + goto nla_put_failure; 169 171 if (nla_put_u8(skb, IFLA_HSR_PROTOCOL, proto)) 170 172 goto nla_put_failure; 171 173