[pkg-wpa-devel] [PATCH] remove bitrotted locking code

Kel Modderman kelrin at tpg.com.au
Sun Sep 24 04:23:02 UTC 2006


On Sunday 24 September 2006 12:34, Jason Lunz wrote:
> In figuring out why my wpa_cli/wpa_action kept getting into endless
> loops, I looked at the locking code and noticed that it doesn't seem to
> do anything useful. This patch removes it.

It is mostly useful only while wpa_action is being called by wpa_cli daemon 
and the user decides to do a 'wpa_action $iface stop' or so. I would not 
say "bitrotted" by would concede that wpa_lock* was poorly implemented.

>
> wpa_action_wait is clearly a noop - it does nothing unless the file
> $WPA_LOCKFILE exists, but the $WPA_LOCKFILE variable is never set.

Its not a variable, its a constant (sourced from functions.sh).

>
> wpa_action_unlock is a noop by the same reasoning. The only reason the
> lockfile is ever being deleted was that init_wpa_cli and kill_wpa_cli
> do so when they are called by ifupdown.sh in response to interface
> post-up and pre-down hooks. This is clearly unintentional, since it
> unlocks before the (impotent) call to wpa_action_unlock.
>
> The stated purpose of this stuff is, according to the changelog, to help
> with infinite event loops like mine:
>
> wpasupplicant (0.5.4-3) unstable; urgency=low
>
>   * ...
>   * Implement basic locking for wpa_action action's for when the user
> callable "stop" action is executed while wpa_action is busy configuring the
> device. The wpa_cli daemon is killed, then wpa_action waits for the current
> action to finish gracefully before killing wpa_suppliant. This helps avoid
> inconsistencies with ifupdown when volatile conditions are experienced as
> part of the roaming setup (for example, driver problems causing connection
> loops).
>
> It didn't help my case at all; it only made it more confusing to find a
> working solution. Better to delete this code.

Applied. The eye sore is gone.

Thanks, Kel.



More information about the Pkg-wpa-devel mailing list