From: Susant Sahani Date: Tue, 21 May 2019 11:59:18 +0000 (+0530) Subject: networkctl: Display MTU X-Git-Tag: v243-rc1~398^2~2 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=4015d106d411c65bf22f142660a145a21e2fad9a;p=systemd%2F.git networkctl: Display MTU 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 --- 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;