X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fnetwork.c;h=2d606e4c1c563a1d522e41e8e0282e2ffb57a9fe;hp=28e3a29cb2b3621beb3c7ea69c6a06927fc86fe0;hb=3325aa09f31b4cc145ab8abfed44ab5f3b6a7b96;hpb=f611bde3f182e9a4befb48a0160d1831708aca67;ds=sidebyside 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;