summaryrefslogtreecommitdiffstats
path: root/discover/network.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-09-19 21:48:32 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-09-19 21:48:32 +0800
commit3325aa09f31b4cc145ab8abfed44ab5f3b6a7b96 (patch)
treed225159d8ab98e027838a3107d8f14d3ce25287a /discover/network.c
parentf611bde3f182e9a4befb48a0160d1831708aca67 (diff)
downloadtalos-petitboot-3325aa09f31b4cc145ab8abfed44ab5f3b6a7b96.tar.gz
talos-petitboot-3325aa09f31b4cc145ab8abfed44ab5f3b6a7b96.zip
discover/network: ignore devices with zero MTU
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/network.c')
-rw-r--r--discover/network.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/discover/network.c b/discover/network.c
index 28e3a29..2d606e4 100644
--- a/discover/network.c
+++ b/discover/network.c
@@ -325,6 +325,7 @@ static int network_handle_nlmsg(struct network *network, struct nlmsghdr *nlmsg)
struct interface *interface;
struct ifinfomsg *info;
struct rtattr *attr;
+ unsigned int mtu;
uint8_t ifaddr[6];
char ifname[IFNAMSIZ+1];
int attrlen, type;
@@ -355,13 +356,17 @@ static int network_handle_nlmsg(struct network *network, struct nlmsghdr *nlmsg)
strncpy(ifname, data, IFNAMSIZ);
have_ifname = true;
break;
+
+ case IFLA_MTU:
+ mtu = *(unsigned int *)data;
+ break;
}
}
if (!have_ifaddr || !have_ifname)
return -1;
- if (type == RTM_DELLINK) {
+ if (type == RTM_DELLINK || mtu == 0) {
interface = find_interface_by_ifindex(network, info->ifi_index);
if (!interface)
return 0;
OpenPOWER on IntegriCloud