aboutsummaryrefslogtreecommitdiffstats
path: root/package/hostapd
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-11-08 14:22:56 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-11-08 14:22:56 +0000
commitec20b840484a53594775dfa6939f93d7bbaf1e29 (patch)
tree6f03771412ad40f4d27f179b685519c8a68f6b1b /package/hostapd
parentb6aef59ea82f994b2cd7e926aa2d6c73ee5bdba4 (diff)
downloadupstream-ec20b840484a53594775dfa6939f93d7bbaf1e29.tar.gz
upstream-ec20b840484a53594775dfa6939f93d7bbaf1e29.tar.bz2
upstream-ec20b840484a53594775dfa6939f93d7bbaf1e29.zip
hostapd: add code to prevent accidentally bridging non-wds sta mode interfaces
SVN-Revision: 28858
Diffstat (limited to 'package/hostapd')
-rw-r--r--package/hostapd/files/wpa_supplicant.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/package/hostapd/files/wpa_supplicant.sh b/package/hostapd/files/wpa_supplicant.sh
index 6112517f37..1ab6c663e5 100644
--- a/package/hostapd/files/wpa_supplicant.sh
+++ b/package/hostapd/files/wpa_supplicant.sh
@@ -23,6 +23,15 @@ wpa_supplicant_setup_vif() {
config_set "$vif" bridge "$bridge"
}
+ local mode ifname wds
+ config_get mode "$vif" mode
+ config_get ifname "$vif" ifname
+ config_get_bool wds "$vif" wds 0
+ [ -z "$bridge" ] || [ "$mode" = ap ] || [ "$mode" = sta -a $wds -eq 1 ] || {
+ echo "wpa_supplicant_setup_vif($ifname): Refusing to bridge $mode mode interface"
+ return 1
+ }
+
case "$enc" in
*none*)
key_mgmt='NONE'