aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/hostapd/files
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2015-02-13 10:53:54 +0000
committerJohn Crispin <blogic@openwrt.org>2015-02-13 10:53:54 +0000
commitb79d1ca819a2f74eccce637d17d4a69d9d899c75 (patch)
treeef2a1abb7d1febcfc43af09b3c483bce85e8c525 /package/network/services/hostapd/files
parent83f1e61682d8a0f3ef0d875831084a648e23c3ea (diff)
downloadmaster-187ad058-b79d1ca819a2f74eccce637d17d4a69d9d899c75.tar.gz
master-187ad058-b79d1ca819a2f74eccce637d17d4a69d9d899c75.tar.bz2
master-187ad058-b79d1ca819a2f74eccce637d17d4a69d9d899c75.zip
hostapd: backport BSSID black/whitelists
This change adds the configuration options "bssid_whitelist" and "bssid_blacklist" used to limit the AP selection of a network to a specified (finite) set or discard certain APs. This can be useful for environments where multiple networks operate using the same SSID and roaming between those is not desired. It is also useful to ignore a faulty or otherwise unwanted AP. In many applications it is useful not just to enumerate a group of well known access points, but to use a address/mask notation to match an entire set of addresses (ca:ff:ee:00:00:00/ff:ff:ff:00:00:00). This is especially useful if an OpenWrt device with two radios is used to retransmit the same network (one in AP mode for other clients, one as STA for the uplink); the following configuration prevents the device from associating with itself, given that the own AP to be avoided is using the bssid 'C0:FF:EE:D0:0D:42': config wifi-iface option device 'radio2' option network 'uplink' option mode 'sta' option ssid 'MyNetwork' option encryption 'none' list bssid_blacklist 'C0:FF:EE:D0:0D:42/00:FF:FF:FF:FF:FF' This change consists of the following cherry-picked upstream commits: b3d6a0a8259002448a29f14855d58fe0a624ab76 b83e455451a875ba233b3b8ac29aff8b62f064f2 79cd993a623e101952b81fa6a29c674cd858504f (squashed to implement bssid_{white,black}lists) 0047306bc9ab7d46e8cc22ff9a3e876c47626473 (Add os_snprintf_error() helper) Signed-off-by: Stefan Tomanek <stefan.tomanek+openwrt@wertarbyte.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44438 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/services/hostapd/files')
-rw-r--r--package/network/services/hostapd/files/netifd.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh
index 83fb129fe1..3a64689428 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -153,6 +153,9 @@ hostapd_common_add_bss_config() {
config_add_string macfilter 'macfile:file'
config_add_array 'maclist:list(macaddr)'
+ config_add_array bssid_blacklist
+ config_add_array bssid_whitelist
+
config_add_int mcast_rate
config_add_array basic_rate
config_add_array supported_rates
@@ -580,6 +583,12 @@ wpa_supplicant_add_network() {
[ -n "$bssid" ] && append network_data "bssid=$bssid" "$N$T"
[ -n "$beacon_int" ] && append network_data "beacon_int=$beacon_int" "$N$T"
+ local bssid_blacklist bssid_whitelist
+ json_get_values bssid_blacklist bssid_blacklist
+ json_get_values bssid_whitelist bssid_whitelist
+
+ [ -n "$bssid_blacklist" ] && append network_data "bssid_blacklist=$bssid_blacklist" "$N$T"
+ [ -n "$bssid_whitelist" ] && append network_data "bssid_whitelist=$bssid_whitelist" "$N$T"
[ -n "$basic_rate" ] && {
local br rate_list=