diff mbox series

[iproute2] ip: display the 'netns-immutable' property

Message ID 20250328095826.706221-1-nicolas.dichtel@6wind.com (mailing list archive)
State New
Delegated to: David Ahern
Headers show
Series [iproute2] ip: display the 'netns-immutable' property | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Nicolas Dichtel March 28, 2025, 9:58 a.m. UTC
The user needs to specify '-details' to have it.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 ip/ipaddress.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 70b3d513e510..91d78874699b 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -1182,6 +1182,11 @@  int print_linkinfo(struct nlmsghdr *n, void *arg)
 				   "max_mtu", "maxmtu %u ",
 				   rta_getattr_u32(tb[IFLA_MAX_MTU]));
 
+		if (tb[IFLA_NETNS_IMMUTABLE] &&
+		    rta_getattr_u8(tb[IFLA_NETNS_IMMUTABLE]))
+			print_bool(PRINT_ANY, "netns-immutable", "netns-immutable ",
+				   true);
+
 		if (tb[IFLA_LINKINFO])
 			print_linktype(fp, tb[IFLA_LINKINFO]);