From 799686e40df455b136dfe41e805cd04a2813cc00 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sun, 20 Apr 2008 14:24:35 +0000 Subject: Fix force_preferred, #60. --- net/iwconfig.sh.BSD.in | 5 +++-- net/iwconfig.sh.Linux.in | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/net/iwconfig.sh.BSD.in b/net/iwconfig.sh.BSD.in index 3a276cda..813fd2f4 100644 --- a/net/iwconfig.sh.BSD.in +++ b/net/iwconfig.sh.BSD.in @@ -414,8 +414,9 @@ iwconfig_connect_preferred() [ $# = 0 ] && eval set -- $(_flatten_array "preferred_aps") [ $# = 0 ] && return 1 - local ssid= i=0 mode= mac= caps= freq= chan= + local ssid= i= mode= mac= caps= freq= chan= for ssid; do + i=0 while [ ${i} -le ${APS} ] ; do eval e=\$SSID_${i} if [ "${e}" = "${ssid}" ] ; then @@ -484,7 +485,7 @@ iwconfig_defaults() iwconfig_configure() { - local x APS + local x= APS=-1 eval SSID=\$ssid_${IFVAR} # Setup ad-hoc mode? diff --git a/net/iwconfig.sh.Linux.in b/net/iwconfig.sh.Linux.in index 1610cba3..85b6cb66 100644 --- a/net/iwconfig.sh.Linux.in +++ b/net/iwconfig.sh.Linux.in @@ -525,7 +525,7 @@ iwconfig_force_preferred() i=$((${i} + 1)) done if ! ${found_AP}; then - SSID=${e} + SSID=${ssid} iwconfig_associate && return 0 fi done @@ -610,7 +610,7 @@ iwconfig_defaults() iwconfig_configure() { - local x= APS= + local x= APS=-1 eval SSID=\$ssid_${IFVAR} # Support old variable -- cgit v1.2.3