summaryrefslogtreecommitdiff
path: root/package/base-files
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2015-07-26 01:42:21 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2015-07-26 10:36:36 +0200
commitc3b44cf4fa4ff91522ba9cfb58669003de1808c2 (patch)
tree62b9a7b9e30c1f0071d456d4a269dd4ac2d3e608 /package/base-files
parent6542f1d72d9eee897e5e7cf7c39bb10fb6a71cb5 (diff)
package/base-files: wireless: allow setting pairwise algorithm
Not perfect, since allowing WPA+WPA2 means setting wpa_pairwise as well as rsn_pairwise, but I do not want to add unnecessary complexity to interface configuration. This is relevant for my X40 with ipw2200, which bugs for CCMP pairwise cipher.
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/src/etc/network/if-pre-up.d/04-wireless9
1 files changed, 7 insertions, 2 deletions
diff --git a/package/base-files/src/etc/network/if-pre-up.d/04-wireless b/package/base-files/src/etc/network/if-pre-up.d/04-wireless
index 746c166e3..f34e61e2b 100755
--- a/package/base-files/src/etc/network/if-pre-up.d/04-wireless
+++ b/package/base-files/src/etc/network/if-pre-up.d/04-wireless
@@ -12,6 +12,7 @@ set -e
wpa=0
wpa1=0
wpa2=0
+pairwise=""
case "$IF_WIRELESS_SECURITY" in
none)
@@ -23,10 +24,12 @@ case "$IF_WIRELESS_SECURITY" in
wpa)
sec=1
wpa1=1
+ pairwise=TKIP
;;
wpa2)
sec=1
wpa2=1
+ pairwise=CCMP
;;
wpa+wpa2)
sec=1
@@ -37,6 +40,8 @@ case "$IF_WIRELESS_SECURITY" in
;;
esac
+[ "$IF_WIRELESS_PAIRWISE" ] || IF_WIRELESS_PAIRWISE=$pairwise
+
case "$IF_WIRELESS_MODE" in
ap)
logger -t hostap "Creating hostapd configuration"
@@ -55,14 +60,14 @@ case "$IF_WIRELESS_MODE" in
logger -t hostap "using WPA for security"
echo "wpa=1" >> /tmp/hostapd.conf
echo "wpa_key_mgmt=WPA-PSK" >> /tmp/hostapd.conf
- echo "wpa_pairwise=TKIP" >> /tmp/hostapd.conf
+ echo "wpa_pairwise=$IF_WIRELESS_PAIRWISE" >> /tmp/hostapd.conf
echo "wpa_passphrase=$IF_WIRELESS_PASSPHRASE" >> /tmp/hostapd.conf
}
[ $wpa2 -eq 1 ] && {
logger -t hostap "using WPA2 for security"
echo "wpa=2" >> /tmp/hostapd.conf
echo "wpa_key_mgmt=WPA-PSK" >> /tmp/hostapd.conf
- echo "rsn_pairwise=CCMP" >> /tmp/hostapd.conf
+ echo "rsn_pairwise=$IF_WIRELESS_PAIRWISE" >> /tmp/hostapd.conf
echo "wpa_passphrase=$IF_WIRELESS_PASSPHRASE" >> /tmp/hostapd.conf
}
[ $wpa -eq 1 ] && {