From 122ba57936fc0e006e4d786666fb7c825a41ab54 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 21 Oct 2011 12:43:53 +0300 Subject: [PATCH] Interworking: Filter Probe Request frames based on HESSID and ANT Do not reply to Interworking-enabled Probe Request frames if they request mismatching HESSID or ANT. --- src/ap/beacon.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 096a446c7..528808c2a 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -297,6 +297,36 @@ void handle_probe_req(struct hostapd_data *hapd, return; } +#ifdef CONFIG_INTERWORKING + if (elems.interworking && elems.interworking_len >= 1) { + u8 ant = elems.interworking[0] & 0x0f; + if (ant != INTERWORKING_ANT_WILDCARD && + ant != hapd->conf->access_network_type) { + wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR + " for mismatching ANT %u ignored", + MAC2STR(mgmt->sa), ant); + return; + } + } + + if (elems.interworking && + (elems.interworking_len == 7 || elems.interworking_len == 9)) { + const u8 *hessid; + if (elems.interworking_len == 7) + hessid = elems.interworking + 1; + else + hessid = elems.interworking + 1 + 2; + if (!is_broadcast_ether_addr(hessid) && + os_memcmp(hessid, hapd->conf->hessid, ETH_ALEN) != 0) { + wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR + " for mismatching HESSID " MACSTR + " ignored", + MAC2STR(mgmt->sa), MAC2STR(hessid)); + return; + } + } +#endif /* CONFIG_INTERWORKING */ + /* TODO: verify that supp_rates contains at least one matching rate * with AP configuration */ #define MAX_PROBERESP_LEN 768