summaryrefslogtreecommitdiffstats
path: root/src/network/networkctl.c
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@gmail.com>2019-05-21 13:59:18 +0200
committerSusant Sahani <ssahani@gmail.com>2019-05-21 13:59:18 +0200
commit4015d106d411c65bf22f142660a145a21e2fad9a (patch)
tree11b20272e22f064ef59bf52f8a58127dbb8f7ffd /src/network/networkctl.c
parentMerge pull request #12510 from keszybz/test-directives (diff)
downloadsystemd-4015d106d411c65bf22f142660a145a21e2fad9a.tar.xz
systemd-4015d106d411c65bf22f142660a145a21e2fad9a.zip
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
Diffstat (limited to 'src/network/networkctl.c')
-rw-r--r--src/network/networkctl.c2
1 files changed, 1 insertions, 1 deletions
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, &ETHER_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;