]> git.feebdaed.xyz Git - 0xmirror/iproute2.git/commitdiff
iplink: hsr: add protocol version to print_opt output
authorJan Vaclav <jvaclav@redhat.com>
Mon, 27 Oct 2025 13:52:06 +0000 (14:52 +0100)
committerDavid Ahern <dsahern@kernel.org>
Mon, 3 Nov 2025 16:32:48 +0000 (09:32 -0700)
Since this attribute is now exposed by kernel in net-next[1],
let's also add it here, so that it can be inspected from
userspace.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=16a2206354d1

Signed-off-by: Jan Vaclav <jvaclav@redhat.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/iplink_hsr.c

index 42adb43009b7e1d5ed80b6e17b3944cb85bb97c8..d79a4a401a0c72f764bb2afae1b39ccf7554eae8 100644 (file)
@@ -165,6 +165,9 @@ static void hsr_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
        if (tb[IFLA_HSR_PROTOCOL])
                print_hhu(PRINT_ANY, "proto", "proto %hhu ",
                          rta_getattr_u8(tb[IFLA_HSR_PROTOCOL]));
+       if (tb[IFLA_HSR_VERSION])
+               print_hhu(PRINT_ANY, "version", "version %hhu ",
+                         rta_getattr_u8(tb[IFLA_HSR_VERSION]));
 }
 
 static void hsr_print_help(struct link_util *lu, int argc, char **argv,