aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-04-20 15:00:07 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-04-20 15:00:07 +0000
commit4ffcccc4d3bca099999d044c48e0c843bf4dd78c (patch)
tree034b1a0f0ea623267139e49b6b038b2a023f133b /package
parent1e5d6ff1f7ecbf4cdfdc0cff7646584f9a8034fb (diff)
downloadmaster-187ad058-4ffcccc4d3bca099999d044c48e0c843bf4dd78c.tar.gz
master-187ad058-4ffcccc4d3bca099999d044c48e0c843bf4dd78c.tar.bz2
master-187ad058-4ffcccc4d3bca099999d044c48e0c843bf4dd78c.zip
hostapd/netifd: encrypted mesh with wpa_supplicant
Signed-off-by: Daniel Golle <daniel@makrotopia.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45519 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/network/services/hostapd/files/netifd.sh47
1 files changed, 29 insertions, 18 deletions
diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh
index 53743a14f1..23d2e7e83e 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -546,7 +546,7 @@ wpa_supplicant_add_network() {
local T=" "
local wpa_key_mgmt="WPA-PSK"
- local scan_ssid="1"
+ local scan_ssid="scan_ssid=1"
local freq
[[ "$_w_mode" = "adhoc" ]] && {
@@ -557,12 +557,22 @@ wpa_supplicant_add_network() {
append network_data "frequency=$freq" "$N$T"
}
- scan_ssid=0
+ scan_ssid="scan_ssid=0"
[ "$_w_driver" = "nl80211" ] || wpa_key_mgmt="WPA-NONE"
}
- [[ "$_w_mode" = adhoc ]] && append network_data "$_w_modestr" "$N$T"
+ [[ "$_w_mode" = "mesh" ]] && {
+ append network_data "mode=5" "$N$T"
+ [ -n "$channel" ] && {
+ freq="$(get_freq "$phy" "$channel")"
+ append network_data "frequency=$freq" "$N$T"
+ }
+ wpa_key_mgmt="SAE"
+ scan_ssid=""
+ }
+
+ [[ "$_w_mode" = "adhoc" -o "$_w_mode" = "mesh" ]] && append network_data "$_w_modestr" "$N$T"
case "$auth_type" in
none) ;;
@@ -606,21 +616,22 @@ wpa_supplicant_add_network() {
;;
esac
- case "$wpa" in
- 1)
- append network_data "proto=WPA" "$N$T"
- ;;
- 2)
- append network_data "proto=RSN" "$N$T"
- ;;
- esac
-
- case "$ieee80211w" in
- [012])
- [ "$wpa" -ge 2 ] && append network_data "ieee80211w=$ieee80211w" "$N$T"
- ;;
- esac
+ [ "$mode" = mesh ] || {
+ case "$wpa" in
+ 1)
+ append network_data "proto=WPA" "$N$T"
+ ;;
+ 2)
+ append network_data "proto=RSN" "$N$T"
+ ;;
+ esac
+ case "$ieee80211w" in
+ [012])
+ [ "$wpa" -ge 2 ] && append network_data "ieee80211w=$ieee80211w" "$N$T"
+ ;;
+ esac
+ }
local beacon_int brates mrate
[ -n "$bssid" ] && append network_data "bssid=$bssid" "$N$T"
[ -n "$beacon_int" ] && append network_data "beacon_int=$beacon_int" "$N$T"
@@ -652,7 +663,7 @@ wpa_supplicant_add_network() {
cat >> "$_config" <<EOF
network={
- scan_ssid=$scan_ssid
+ $scan_ssid
ssid="$ssid"
key_mgmt=$key_mgmt
$network_data