X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=hostapd%2Fdriver_nl80211.c;h=78b9a55ae84fc99bc0c08f480ea80883953f4146;hb=f82ef4d8dba197a96592fcf30da62606becdf18a;hp=500c83dd7cc6b1071fa131e5d6294c60e0cb7534;hpb=c043aadc40a3872fac301138b6854d85d9facd97;p=wpasupplicant diff --git a/hostapd/driver_nl80211.c b/hostapd/driver_nl80211.c index 500c83d..78b9a55 100644 --- a/hostapd/driver_nl80211.c +++ b/hostapd/driver_nl80211.c @@ -1731,7 +1731,6 @@ static void handle_frame(struct i802_driver_data *drv, static void handle_eapol(int sock, void *eloop_ctx, void *sock_ctx) { struct i802_driver_data *drv = eloop_ctx; - struct hostapd_data *hapd = drv->hapd; struct sockaddr_ll lladdr; unsigned char buf[3000]; int len; @@ -1744,8 +1743,13 @@ static void handle_eapol(int sock, void *eloop_ctx, void *sock_ctx) return; } - if (have_ifidx(drv, lladdr.sll_ifindex)) + if (have_ifidx(drv, lladdr.sll_ifindex)) { + struct hostapd_data *hapd; + hapd = hostapd_sta_get_bss(drv->hapd, lladdr.sll_addr); + if (!hapd) + return; hostapd_eapol_receive(hapd, lladdr.sll_addr, buf, len); + } } @@ -2433,7 +2437,6 @@ static int i802_ht_scan(struct i802_driver_data *drv) static int i802_init_sockets(struct i802_driver_data *drv, const u8 *bssid) { struct ifreq ifr; - struct sockaddr_ll addr; drv->ioctl_sock = socket(PF_INET, SOCK_DGRAM, 0); if (drv->ioctl_sock < 0) { @@ -2520,12 +2523,6 @@ static int i802_init_sockets(struct i802_driver_data *drv, const u8 *bssid) if (hostapd_set_iface_flags(drv, drv->iface, 1)) goto fail1; - memset(&addr, 0, sizeof(addr)); - addr.sll_family = AF_PACKET; - addr.sll_ifindex = ifr.ifr_ifindex; - wpa_printf(MSG_DEBUG, "Opening raw packet socket for ifindex %d", - addr.sll_ifindex); - drv->eapol_sock = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_PAE)); if (drv->eapol_sock < 0) { perror("socket(PF_PACKET, SOCK_DGRAM, ETH_P_PAE)");