Commit f18c231f authored by Jan Vaclav's avatar Jan Vaclav Committed by Jakub Kicinski
Browse files

net/hsr: add interlink to fill_info output



Currently, it is possible to configure the interlink
port, but no way to read it back from userspace.

Add it to the output of hsr_fill_info(), so it can be
read from userspace, for example:

$ ip -d link show hsr0
12: hsr0: <BROADCAST,MULTICAST> mtu ...
...
hsr slave1 veth0 slave2 veth1 interlink veth2 ...

Signed-off-by: default avatarJan Vaclav <jvaclav@redhat.com>
Reviewed-by: default avatarFernando Fernandez Mancera <fmancera@suse.de>
Link: https://patch.msgid.link/20251015101001.25670-2-jvaclav@redhat.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e1048520
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -160,6 +160,12 @@ static int hsr_fill_info(struct sk_buff *skb, const struct net_device *dev)
			goto nla_put_failure;
	}

	port = hsr_port_get_hsr(hsr, HSR_PT_INTERLINK);
	if (port) {
		if (nla_put_u32(skb, IFLA_HSR_INTERLINK, port->dev->ifindex))
			goto nla_put_failure;
	}

	if (nla_put(skb, IFLA_HSR_SUPERVISION_ADDR, ETH_ALEN,
		    hsr->sup_multicast_addr) ||
	    nla_put_u16(skb, IFLA_HSR_SEQ_NR, hsr->sequence_nr))