[PATCHi,iproute2-next] ip: show min and max mtu

Message ID 20180727204350.21799-1-stephen@networkplumber.org
State Accepted
Delegated to: David Ahern
Headers show
Series
  • [PATCHi,iproute2-next] ip: show min and max mtu
Related show

Commit Message

Stephen Hemminger July 27, 2018, 8:43 p.m.
From: Stephen Hemminger <sthemmin@microsoft.com>

Add min/max MTU to the link details

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 include/uapi/linux/if_link.h |  2 ++
 ip/ipaddress.c               | 10 ++++++++++
 2 files changed, 12 insertions(+)

Comments

David Ahern Aug. 12, 2018, 9:25 p.m. | #1
On 7/27/18 2:43 PM, Stephen Hemminger wrote:
> From: Stephen Hemminger <sthemmin@microsoft.com>
> 
> Add min/max MTU to the link details
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  include/uapi/linux/if_link.h |  2 ++
>  ip/ipaddress.c               | 10 ++++++++++
>  2 files changed, 12 insertions(+)
> 

applied to iproute2-next. Thanks

Patch

diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 26e8cf8b45aa..8456ff254015 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -164,6 +164,8 @@  enum {
 	IFLA_CARRIER_UP_COUNT,
 	IFLA_CARRIER_DOWN_COUNT,
 	IFLA_NEW_IFINDEX,
+	IFLA_MIN_MTU,
+	IFLA_MAX_MTU,
 	__IFLA_MAX
 };
 
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index bcee9ab731ce..85958e1a9cef 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -1012,6 +1012,16 @@  int print_linkinfo(const struct sockaddr_nl *who,
 				   " promiscuity %u ",
 				   rta_getattr_u32(tb[IFLA_PROMISCUITY]));
 
+		if (tb[IFLA_MIN_MTU])
+			print_uint(PRINT_ANY,
+				   "min_mtu", "minmtu %u ",
+				   rta_getattr_u32(tb[IFLA_MIN_MTU]));
+
+		if (tb[IFLA_MAX_MTU])
+			print_uint(PRINT_ANY,
+				   "max_mtu", "maxmtu %u ",
+				   rta_getattr_u32(tb[IFLA_MAX_MTU]));
+
 		if (tb[IFLA_LINKINFO])
 			print_linktype(fp, tb[IFLA_LINKINFO]);