ifupdown script fails to terminate wpasupplicant

Bug #72152 reported by Hadmut Danisch
6
Affects Status Importance Assigned to Milestone
wpasupplicant (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: wpasupplicant

Hi,

I am using wpasupplicant in the roaming mode as described in README.modes.

Taking the interface up works (manual method as described).

But then, when taking down the interface, the script fails to terminate the wpasupplicant and the wpa_cli. Thus, after taking down the interface, those deamons keep running.

The next time the interface is taken up, the up script detects a running daemon and again does nothing, i.e. fails.

The reason might be that the script checks for the presence of a running wpa_cli in a very early stage and exits if one exist, even in the if-down phase.

When the script immediately terminates if a wpa_cli is running, it obviously does not terminate the daemon.

regards

Revision history for this message
Reinhard Tartler (siretart) wrote :

please attach your /etc/network/interfaces to this bug.

Do you happen to use 'wpa-roam'? in this case, use 'wpa_action $IFACE stop' to bring down your interface.

Changed in wpasupplicant:
status: Unconfirmed → Needs Info
Revision history for this message
Hadmut Danisch (hadmut) wrote : Re: [Bug 72152] Re: ifupdown script fails to terminate wpasupplicant

On Fri, Nov 17, 2006 at 10:49:06AM -0000, Reinhard Tartler wrote:
> please attach your /etc/network/interfaces to this bug.

Currently I'm away from the notebook, I'll send it later.

> Do you happen to use 'wpa-roam'? in this case, use 'wpa_action $IFACE
> stop' to bring down your interface.

Yup.

Where would I have to use wpa_action? In the manual clause or in the
subclause selected by wpasupplicant?

regards
Hadmut

Revision history for this message
Reinhard Tartler (siretart) wrote :

>> Do you happen to use 'wpa-roam'? in this case, use 'wpa_action $IFACE
>> stop' to bring down your interface.
>
> Yup.
>
> Where would I have to use wpa_action? In the manual clause or in the
> subclause selected by wpasupplicant?

No, when using 'wpa-roam' mode, then you have to use 'wpa_action $FACE stop'
*instead* of 'ifdown $IFCE'. This is due to limitations in
ifupdown. Please refer to the wpa_action(8) man page for further details.

Revision history for this message
Cedric Schieli (cschieli) wrote :

Here is how I get rid of this inconsistency :

in interfaces file I put those stanzas :

iface wlan0 inet manual
  wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp
  wpa-roam slave

iface home inet static
  wpa-roam slave
  address ...

With attached patch, "wpa_action wlan0 stop" is invoked when issuing "ifdown wlan0"

Revision history for this message
kelmo (kelrin) wrote :

What happens when you roam from network A to network B with this patch applied? Or an intermittent loss or re - connection to any network?

When leaving a network, wpa_cli daemon will invoke wpa_action after recieving the disconnected signal via the control socket:
`wpa_action $IFACE DISCONNECTED'

wpa_action will then call ifdown:
`ifdown $IFACE'

At this point, the code from the above patch will then terminate the wpa_* daemons, via wpa_action, due to the logical mapping having a `wpa-roam slave' line in its stanza. Network B is now out of reach, or your connection is lost if you experience a DISCONNECTED event for whatever reason.

Please correct me if wrong.

Thanks, Kel.

Revision history for this message
Cedric Schieli (cschieli) wrote :

You're right.
I've never roamed without shutting down ;-)
The point is I often ifdown...rmmod...insmod...ifup in order to update to
latest CVS for my Ralink based card.
I now understand better the wpa_action infrastructure and admit my patch
will not fit in it.

Regards,
Cedric

2006/11/27, kelmo <email address hidden>:
>
> What happens when you roam from network A to network B with this patch
> applied? Or an intermittent loss or re - connection to any network?
>
> When leaving a network, wpa_cli daemon will invoke wpa_action after
> recieving the disconnected signal via the control socket:
> `wpa_action $IFACE DISCONNECTED'
>
> wpa_action will then call ifdown:
> `ifdown $IFACE'
>
> At this point, the code from the above patch will then terminate the
> wpa_* daemons, via wpa_action, due to the logical mapping having a `wpa-
> roam slave' line in its stanza. Network B is now out of reach, or your
> connection is lost if you experience a DISCONNECTED event for whatever
> reason.
>
> Please correct me if wrong.
>
> Thanks, Kel.
>
> --
> ifupdown script fails to terminate wpasupplicant
> https://launchpad.net/bugs/72152
>

Revision history for this message
Reinhard Tartler (siretart) wrote :

Hadmut, do you still experience this bug? We are still waiting for your /etc/network/interfaces file to find out what this bug is about.

Revision history for this message
Hadmut Danisch (hadmut) wrote :

Sorry for the delay, I was in the australian outback without notebook and internet access, and then busy with moving my (physical) home.

I'll attach my /etc/network/interfaces (stripped down, some irrelevant things removed).

My wpasupplicant.conf contains an entry like

network={
        ssid="athome"
        priority=100
        key_mgmt=WPA-PSK
        psk="somepassword"
        id_str="athome"
}

so the wpa supplicant scripts successfully choose the athome entry in /etc/network/interfaces.

The problem still exists, although in most cases I simpy shut down the notebook anyway. If I need to
take down the interface only, I have to call "wpa_action wlan0 stop" manually.

I guess it could work if I put this command as a down command in either the wlan0 or the athome stanza. But the next thing to do is to upgrade the notebook to feisty.

regards

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for wpasupplicant (Ubuntu) because there has been no activity for 60 days.]

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.