aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/authsae
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-04-12 21:22:17 +0000
committerJohn Crispin <blogic@openwrt.org>2014-04-12 21:22:17 +0000
commitb41d91bff67577039a9fb9825ba3efd1d0a163a6 (patch)
treeb0abca4d1d2a258b950658fbba575a5c91e33316 /package/network/services/authsae
parent864d4981538048d12b91b96706bcae7bd3623132 (diff)
downloadmaster-187ad058-b41d91bff67577039a9fb9825ba3efd1d0a163a6.tar.gz
master-187ad058-b41d91bff67577039a9fb9825ba3efd1d0a163a6.tar.bz2
master-187ad058-b41d91bff67577039a9fb9825ba3efd1d0a163a6.zip
802.11s: fix authsae support in netifd
This patch implements support for 802.11s protected mesh wireless networks (using authsae) in the netifd framework. Until meshd-nl80211 implements a proper -P option for the PID file, this uses shell backgrounding in order to be able to get the PID for the process. Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40497 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/services/authsae')
-rw-r--r--package/network/services/authsae/files/lib/wifi/authsae.sh44
1 files changed, 24 insertions, 20 deletions
diff --git a/package/network/services/authsae/files/lib/wifi/authsae.sh b/package/network/services/authsae/files/lib/wifi/authsae.sh
index daa43eb22a..d8c5598ed5 100644
--- a/package/network/services/authsae/files/lib/wifi/authsae.sh
+++ b/package/network/services/authsae/files/lib/wifi/authsae.sh
@@ -1,28 +1,24 @@
authsae_start_interface() {
- local device="$1" # to use the correct channel
- local vif="$2"
- local band
+ local mcast_rate
+ local mesh_htmode
+ local mesh_band
+ local authsae_conf_file="/var/run/authsae-$ifname.cfg"
+ local ret=1
- cfgfile="/var/run/authsae-$vif.cfg"
- config_get channel "$device" channel
- config_get hwmode "$device" hwmode
- config_get htmode "$device" htmode
- config_get ifname "$vif" ifname
- config_get key "$vif" key
- config_get mesh_id "$vif" mesh_id
- config_get mcast_rate "$vif" mcast_rate "12"
+ json_get_vars mcast_rate
+ set_default mcast_rate "12"
case "$htmode" in
- HT20|HT40+|HT40-) htmode="$htmode";;
- NOHT|none|*) htmode="none";;
+ HT20|HT40+|HT40-) mesh_htmode="$htmode";;
+ *) mesh_htmode="none";;
esac
case "$hwmode" in
- *g*) band=11g;;
- *a*) band=11a;;
+ *g*) mesh_band=11g;;
+ *a*) mesh_band=11a;;
esac
- cat > "$cfgfile" <<EOF
+ cat > "$authsae_conf_file" <<EOF
authsae:
{
sae:
@@ -41,13 +37,21 @@ authsae:
passive = 0;
debug = 0;
mediaopt = 1;
- band = "$band";
+ band = "$mesh_band";
channel = $channel;
- htmode = "$htmode";
+ htmode = "$mesh_htmode";
mcast-rate = $mcast_rate;
};
};
EOF
- ifconfig "$ifname" up
- meshd-nl80211 -i "$ifname" -s "$mesh_id" -c "$cfgfile" -B
+
+ /usr/bin/meshd-nl80211 -i "$ifname" -s "$mesh_id" -c "$authsae_conf_file" </dev/null >/dev/null 2>/dev/null &
+ authsae_pid="$!"
+ ret="$?"
+
+ echo $authsae_pid > /var/run/authsae-$ifname.pid
+ wireless_add_process "$authsae_pid" "/usr/bin/meshd-nl80211" 1
+
+ [ "$ret" != 0 ] && wireless_setup_vif_failed AUTHSAE_FAILED
+ return $ret
}