Fix nl80211 driver to receive EAPOL response
authorArtem Antonov <artem.v.antonov@gmail.com>
Tue, 8 Apr 2008 06:49:06 +0000 (09:49 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 8 Apr 2008 06:49:06 +0000 (09:49 +0300)
This patch fixes nl80211 driver to receive EAPOL response if wlan0 was
added to bridge.

hostapd/driver_nl80211.c

index 1bc46b4..4a2d44c 100644 (file)
@@ -51,6 +51,7 @@ struct i802_driver_data {
        struct hostapd_data *hapd;
 
        char iface[IFNAMSIZ + 1];
+       int bridge;
        int ioctl_sock; /* socket for ioctl() use */
        int wext_sock; /* socket for wireless events */
        int eapol_sock; /* socket for EAPOL frames */
@@ -122,6 +123,9 @@ static int have_ifidx(struct i802_driver_data *drv, int ifidx)
 {
        int i;
 
+       if (ifidx == drv->bridge)
+               return 1;
+
        for (i = 0; i < drv->num_if_indices; i++)
                if (drv->if_indices[i] == ifidx)
                        return 1;
@@ -2280,6 +2284,7 @@ static void *i802_init_bssid(struct hostapd_data *hapd, const u8 *bssid)
 
        drv->num_if_indices = sizeof(drv->default_if_indices) / sizeof(int);
        drv->if_indices = drv->default_if_indices;
+       drv->bridge = if_nametoindex(hapd->conf->bridge);
 
        if (i802_init_sockets(drv, bssid))
                goto failed;