]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip/netkit: print peer policy
authorNikolay Aleksandrov <razor@blackwall.org>
Tue, 6 Aug 2024 10:55:48 +0000 (13:55 +0300)
committerDavid Ahern <dsahern@kernel.org>
Fri, 9 Aug 2024 14:32:46 +0000 (14:32 +0000)
Print also the peer policy, example:
$ ip -d l sh dev netkit0
...
 netkit mode l2 type primary policy blackhole peer policy forward
...

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/iplink_netkit.c

index a838a41078f927375bc45ded8b39759ea849c378..49550a2e74ca3d3d4bf73cda6d2f09b3f9b2fa41 100644 (file)
@@ -166,6 +166,12 @@ static void netkit_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
                print_string(PRINT_ANY, "policy", "policy %s ",
                             netkit_print_policy(policy));
        }
+       if (tb[IFLA_NETKIT_PEER_POLICY]) {
+               __u32 policy = rta_getattr_u32(tb[IFLA_NETKIT_PEER_POLICY]);
+
+               print_string(PRINT_ANY, "peer_policy", "peer policy %s ",
+                            netkit_print_policy(policy));
+       }
 }
 
 static void netkit_print_help(struct link_util *lu,