[pkg-wpa-devel] Bug#407936: wpasupplicant: does not configure interface correctly when it is available at boot time

Ivan Zaera Avellon izaera+debian at gmail.com
Mon Jan 22 14:52:13 CET 2007


Package: wpasupplicant
Version: 0.5.5-4
Severity: normal
Tags: patch


When wpasupplicant is launched from /etc/wpa_supplicant/functions.sh it tries to use flag -W, which is 
supposed to make it wait until the wpa_cli attaches to the socket. The thing is, that the -W is not documented 
in wpasupplicant, and thus, it does not work (at least in my system). This causes wpa_cli to miss the 
CONNECTED event when the wireless network is available from the very first moment. As the event is missed, 
wpa_action is not called and the interface is not configured.

I suggest changing the file /etc/wpa_supplicant/functions.sh, in function init_wpa_cli, so that after wpa_cli 
is launched, we force a disconnect with wpa_cli to make wpasupplicant reconnect again and send the CONNECTED 
event. The proposed code would be:

init_wpa_cli () {
        if [ -n "$WPA_ACTION_SCRIPT" ]; then
                local WPA_CLI_OPTIONS
                WPA_CLI_OPTIONS="-B -P $WPA_CLI_PIDFILE -i $WPA_IFACE"

                wpa_msg verbose "$WPA_CLI_BIN $WPA_CLI_OPTIONS -p $WPA_CTRL_DIR -a $WPA_ACTION_SCRIPT"

                start-stop-daemon --start --oknodo $DAEMON_VERBOSITY \
                        --name $WPA_CLI_PNAME --startas $WPA_CLI_BIN --pidfile $WPA_CLI_PIDFILE \
                        -- $WPA_CLI_OPTIONS -p $WPA_CTRL_DIR -a $WPA_ACTION_SCRIPT

                if [ "$?" != "0" ]; then
                        wpa_msg stderr "$WPA_CLI_BIN daemon failed to start"
                        return 1
                else
                        wpa_msg verbose "force disconnect to assure that wpa_cli receives CONNECTED event"
                        $WPA_CLI_BIN -P $WPA_CLI_PIDFILE -i $WPA_IFACE disconnect
                fi
        fi
}



-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18.8-686-nopiix
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8)

Versions of packages wpasupplicant depends on:
ii  libc6                       2.3.6.ds1-10 GNU C Library: Shared libraries
ii  libdbus-1-3                 1.0.2-1      simple interprocess messaging syst
ii  libncurses5                 5.5-5        Shared libraries for terminal hand
ii  libreadline5                5.2-2        GNU readline and history libraries
ii  libssl0.9.8                 0.9.8c-4     SSL shared libraries
ii  lsb-base                    3.1-22       Linux Standard Base 3.1 init scrip

Versions of packages wpasupplicant recommends:
pn  dhcp3-client                  <none>     (no description available)

-- no debconf information




More information about the Pkg-wpa-devel mailing list