From 4015d106d411c65bf22f142660a145a21e2fad9a Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Tue, 21 May 2019 17:29:18 +0530 Subject: [PATCH] networkctl: Display MTU MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Now the MTU is not displayed. with this patch it's fixed. (networkctl)⚡ % ./networkctl status enp0s31f6 ~/tt/networkctl/build WARNING: systemd-networkd is not running, output will be incomplete. ● 4: enp0s31f6 Link File: /usr/lib/systemd/network/99-default.link Network File: n/a Type: ether State: n/a (unmanaged) Path: pci-0000:00:1f.6 Driver: e1000e Vendor: Intel Corporation Model: Ethernet Connection (2) I219-LM HW Address: 8c:16:45:6c:83:b9 (LCFC(HeFei) Electronics Technology co., ltd) MTU: 1500 --- src/network/networkctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/networkctl.c b/src/network/networkctl.c index d29eb7d0b2..2c6d4c44e1 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -154,7 +154,7 @@ static int decode_link(sd_netlink_message *m, LinkInfo *info, char **patterns) { memcmp(&info->mac_address, ÐER_ADDR_NULL, sizeof(struct ether_addr)) != 0; info->has_mtu = - sd_netlink_message_read_u32(m, IFLA_MTU, &info->mtu) && + sd_netlink_message_read_u32(m, IFLA_MTU, &info->mtu) >= 0 && info->mtu > 0; return 1; -- 2.25.1