mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
hostapd: Remove unused passive scan functionality
This was not really supported by any of the included driver wrappers. If this functionality is desired in the future, this (or something similar) can be added with the changes needed into a driver wrapper to use the mechanism.
This commit is contained in:
parent
c811d5bc78
commit
61693eaa80
@ -72,23 +72,6 @@ enum ieee80211_phytype {
|
||||
* in this link will thus be the least recently used entry. */
|
||||
|
||||
|
||||
static void ap_list_new_ap(struct hostapd_iface *iface, struct ap_info *ap)
|
||||
{
|
||||
wpa_printf(MSG_DEBUG, "New AP detected: " MACSTR, MAC2STR(ap->addr));
|
||||
|
||||
/* TODO: could send a notification message to an external program that
|
||||
* would then determine whether a rogue AP has been detected */
|
||||
}
|
||||
|
||||
|
||||
static void ap_list_expired_ap(struct hostapd_iface *iface, struct ap_info *ap)
|
||||
{
|
||||
wpa_printf(MSG_DEBUG, "AP info expired: " MACSTR, MAC2STR(ap->addr));
|
||||
|
||||
/* TODO: could send a notification message to an external program */
|
||||
}
|
||||
|
||||
|
||||
static int ap_list_beacon_olbc(struct hostapd_iface *iface, struct ap_info *ap)
|
||||
{
|
||||
int i;
|
||||
@ -278,8 +261,6 @@ static struct ap_info * ap_ap_add(struct hostapd_iface *iface, u8 *addr)
|
||||
if (iface->num_ap > iface->conf->ap_table_max_size && ap != ap->prev) {
|
||||
wpa_printf(MSG_DEBUG, "Removing the least recently used AP "
|
||||
MACSTR " from AP table", MAC2STR(ap->prev->addr));
|
||||
if (iface->conf->passive_scan_interval > 0)
|
||||
ap_list_expired_ap(iface, ap->prev);
|
||||
ap_free_ap(iface, ap->prev);
|
||||
}
|
||||
|
||||
@ -365,10 +346,7 @@ void ap_list_process_beacon(struct hostapd_iface *iface,
|
||||
ap->datarate = fi->datarate;
|
||||
}
|
||||
|
||||
if (new_ap) {
|
||||
if (iface->conf->passive_scan_interval > 0)
|
||||
ap_list_new_ap(iface, ap);
|
||||
} else if (ap != iface->ap_list) {
|
||||
if (!new_ap && ap != iface->ap_list) {
|
||||
/* move AP entry into the beginning of the list so that the
|
||||
* oldest entry is always in the end of the list */
|
||||
ap_ap_list_del(iface, ap);
|
||||
@ -412,18 +390,12 @@ static void ap_list_timer(void *eloop_ctx, void *timeout_ctx)
|
||||
|
||||
time(&now);
|
||||
|
||||
/* FIX: it looks like jkm-Purina ended up in busy loop in this
|
||||
* function. Apparently, something can still cause a loop in the AP
|
||||
* list.. */
|
||||
|
||||
while (iface->ap_list) {
|
||||
ap = iface->ap_list->prev;
|
||||
if (ap->last_beacon + iface->conf->ap_table_expiration_time >=
|
||||
now)
|
||||
break;
|
||||
|
||||
if (iface->conf->passive_scan_interval > 0)
|
||||
ap_list_expired_ap(iface, ap);
|
||||
ap_free_ap(iface, ap);
|
||||
}
|
||||
|
||||
@ -495,8 +467,6 @@ int ap_list_reconfig(struct hostapd_iface *iface,
|
||||
now)
|
||||
break;
|
||||
|
||||
if (iface->conf->passive_scan_interval > 0)
|
||||
ap_list_expired_ap(iface, iface->ap_list->prev);
|
||||
ap_free_ap(iface, iface->ap_list->prev);
|
||||
}
|
||||
|
||||
|
@ -2066,12 +2066,6 @@ struct hostapd_config * hostapd_config_read(const char *fname)
|
||||
bss->ssid.vlan_tagged_interface = os_strdup(pos);
|
||||
#endif /* CONFIG_FULL_DYNAMIC_VLAN */
|
||||
#endif /* CONFIG_NO_VLAN */
|
||||
} else if (os_strcmp(buf, "passive_scan_interval") == 0) {
|
||||
conf->passive_scan_interval = atoi(pos);
|
||||
} else if (os_strcmp(buf, "passive_scan_listen") == 0) {
|
||||
conf->passive_scan_listen = atoi(pos);
|
||||
} else if (os_strcmp(buf, "passive_scan_mode") == 0) {
|
||||
conf->passive_scan_mode = atoi(pos);
|
||||
} else if (os_strcmp(buf, "ap_table_max_size") == 0) {
|
||||
conf->ap_table_max_size = atoi(pos);
|
||||
} else if (os_strcmp(buf, "ap_table_expiration_time") == 0) {
|
||||
|
@ -341,9 +341,6 @@ struct hostapd_config {
|
||||
|
||||
const struct wpa_driver_ops *driver;
|
||||
|
||||
int passive_scan_interval; /* seconds, 0 = disabled */
|
||||
int passive_scan_listen; /* usec */
|
||||
int passive_scan_mode;
|
||||
int ap_table_max_size;
|
||||
int ap_table_expiration_time;
|
||||
|
||||
|
@ -458,17 +458,6 @@ hostapd_if_remove(struct hostapd_data *hapd, enum hostapd_driver_if_type type,
|
||||
return hapd->driver->if_remove(hapd->drv_priv, type, ifname, addr);
|
||||
}
|
||||
|
||||
static inline int
|
||||
hostapd_passive_scan(struct hostapd_data *hapd, int now, int our_mode_only,
|
||||
int interval, int _listen, int *channel,
|
||||
int *last_rx)
|
||||
{
|
||||
if (hapd->driver == NULL || hapd->driver->passive_scan == NULL)
|
||||
return -1;
|
||||
return hapd->driver->passive_scan(hapd->drv_priv, now, our_mode_only,
|
||||
interval, _listen, channel, last_rx);
|
||||
}
|
||||
|
||||
static inline struct hostapd_hw_modes *
|
||||
hostapd_get_hw_feature_data(struct hostapd_data *hapd, u16 *num_modes,
|
||||
u16 *flags)
|
||||
|
@ -825,27 +825,11 @@ own_ip_addr=127.0.0.1
|
||||
# 1 = push PMK-R1 to all configured R1KHs whenever a new PMK-R0 is derived
|
||||
#pmk_r1_push=1
|
||||
|
||||
##### Passive scanning ########################################################
|
||||
# Scan different channels every N seconds. 0 = disable passive scanning.
|
||||
#passive_scan_interval=60
|
||||
|
||||
# Listen N usecs on each channel when doing passive scanning.
|
||||
# This value plus the time needed for changing channels should be less than
|
||||
# 32 milliseconds (i.e. 32000 usec) to avoid interruptions to normal
|
||||
# operations. Time needed for channel changing varies based on the used wlan
|
||||
# hardware.
|
||||
# default: disabled (0)
|
||||
#passive_scan_listen=10000
|
||||
|
||||
# Passive scanning mode:
|
||||
# 0 = scan all supported modes (802.11a/b/g/Turbo) (default)
|
||||
# 1 = scan only the mode that is currently used for normal operations
|
||||
#passive_scan_mode=1
|
||||
|
||||
# Maximum number of entries kept in AP table (either for passive scanning or
|
||||
# for detecting Overlapping Legacy BSS Condition). The oldest entry will be
|
||||
##### Neighbor table ##########################################################
|
||||
# Maximum number of entries kept in AP table (either for neigbor table or for
|
||||
# detecting Overlapping Legacy BSS Condition). The oldest entry will be
|
||||
# removed when adding a new entry that would make the list grow over this
|
||||
# limit. Note! Wi-Fi certification for IEEE 802.11g requires that OLBC is
|
||||
# limit. Note! WFA certification for IEEE 802.11g requires that OLBC is
|
||||
# enabled, so this field should not be set to 0 when using IEEE 802.11g.
|
||||
# default: 255
|
||||
#ap_table_max_size=255
|
||||
|
@ -593,7 +593,7 @@ int hostapd_check_ht_capab(struct hostapd_iface *iface)
|
||||
*/
|
||||
int hostapd_select_hw_mode(struct hostapd_iface *iface)
|
||||
{
|
||||
int i, j, ok, ret;
|
||||
int i, j, ok;
|
||||
|
||||
if (iface->num_hw_features < 1)
|
||||
return -1;
|
||||
@ -654,23 +654,7 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = hostapd_passive_scan(iface->bss[0], 0,
|
||||
iface->conf->passive_scan_mode,
|
||||
iface->conf->passive_scan_interval,
|
||||
iface->conf->passive_scan_listen,
|
||||
NULL, NULL);
|
||||
if (ret) {
|
||||
if (ret == -1) {
|
||||
wpa_printf(MSG_DEBUG, "Passive scanning not "
|
||||
"supported");
|
||||
} else {
|
||||
wpa_printf(MSG_ERROR, "Could not set passive "
|
||||
"scanning: %s", strerror(ret));
|
||||
}
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1446,9 +1446,6 @@ void ieee802_11_mgmt(struct hostapd_data *hapd, u8 *buf, size_t len, u16 stype,
|
||||
return;
|
||||
}
|
||||
|
||||
if (fi && fi->passive_scan)
|
||||
return;
|
||||
|
||||
broadcast = mgmt->bssid[0] == 0xff && mgmt->bssid[1] == 0xff &&
|
||||
mgmt->bssid[2] == 0xff && mgmt->bssid[3] == 0xff &&
|
||||
mgmt->bssid[4] == 0xff && mgmt->bssid[5] == 0xff;
|
||||
|
@ -1298,9 +1298,6 @@ struct wpa_driver_ops {
|
||||
int (*bss_add)(void *priv, const char *ifname, const u8 *bssid);
|
||||
int (*bss_remove)(void *priv, const char *ifname);
|
||||
int (*valid_bss_mask)(void *priv, const u8 *addr, const u8 *mask);
|
||||
int (*passive_scan)(void *priv, int now, int our_mode_only,
|
||||
int interval, int _listen, int *channel,
|
||||
int *last_rx);
|
||||
int (*if_add)(const char *iface, void *priv,
|
||||
enum hostapd_driver_if_type type, char *ifname,
|
||||
const u8 *addr);
|
||||
@ -1747,8 +1744,6 @@ struct hostapd_frame_info {
|
||||
u32 channel;
|
||||
u32 datarate;
|
||||
u32 ssi_signal;
|
||||
|
||||
unsigned int passive_scan:1;
|
||||
};
|
||||
|
||||
void hostapd_mgmt_rx(struct hostapd_data *hapd, u8 *buf, size_t len,
|
||||
|
@ -3255,7 +3255,6 @@ const struct wpa_driver_ops wpa_driver_ndis_ops = {
|
||||
NULL /* bss_add */,
|
||||
NULL /* bss_remove */,
|
||||
NULL /* valid_bss_mask */,
|
||||
NULL /* passive_scan */,
|
||||
NULL /* if_add */,
|
||||
NULL /* if_update */,
|
||||
NULL /* if_remove */,
|
||||
|
@ -851,7 +851,6 @@ struct wpa_driver_ops wpa_driver_privsep_ops = {
|
||||
NULL /* bss_add */,
|
||||
NULL /* bss_remove */,
|
||||
NULL /* valid_bss_mask */,
|
||||
NULL /* passive_scan */,
|
||||
NULL /* if_add */,
|
||||
NULL /* if_update */,
|
||||
NULL /* if_remove */,
|
||||
|
@ -2558,7 +2558,6 @@ const struct wpa_driver_ops wpa_driver_test_ops = {
|
||||
NULL /* bss_add */,
|
||||
NULL /* bss_remove */,
|
||||
NULL /* valid_bss_mask */,
|
||||
NULL /* passive_scan */,
|
||||
NULL /* if_add */,
|
||||
NULL /* if_update */,
|
||||
NULL /* if_remove */,
|
||||
|
Loading…
Reference in New Issue
Block a user