]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
vlan: Ignore DELLINK on interfaces that exists
authorMichael Braun <michael-dev@fami-braun.de>
Fri, 10 Apr 2015 12:49:48 +0000 (14:49 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 13 Apr 2015 12:31:56 +0000 (15:31 +0300)
When hitting
> Failed to create interface wlan3.1: -23 (Too many open files in system)
> Try to remove and re-create wlan3.1
hostapd deletes the AP_VLAN interface and then recreates it. Thus the
kernel assigns the same ifidx to the new interfaces and sends DELLINK
and NEWLINK mesages.

As the DELLINK messages are processed after the struct hostapd_vlan is
added, hostapd deletes the struct hostapd_vlan entry, deconfigures the
AP_VLAN interface and leaves vlan_newlink nothing to find afterwards.

So this patch makes DELLINK messages to be ignored when the interface
exists.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
src/ap/vlan_init.c

index dc6501997db03c80550ad5fc2fc3dd63ddb9c3fa..2499bf3ad50efc048dd9a953da4715dd29abc732 100644 (file)
@@ -651,6 +651,11 @@ vlan_read_ifnames(struct nlmsghdr *h, size_t len, int del,
 
        if (!ifname[0])
                return;
+       if (del && if_nametoindex(ifname)) {
+                /* interface still exists, race condition ->
+                 * iface has just been recreated */
+               return;
+       }
 
        wpa_printf(MSG_DEBUG,
                   "VLAN: RTM_%sLINK: ifi_index=%d ifname=%s ifi_family=%d ifi_flags=0x%x (%s%s%s%s)",