Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 202355 Details for
Bug 282840
net-wireless/wpa_supplicant: wpa_cli.sh/openrc racy when wifi connection drops/comes back.
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for wpa_cli.sh
wpa_cli-race-on-connect-disconnect.patch (text/plain), 1.78 KB, created by
Justin Bronder (RETIRED)
on 2009-08-26 21:08:23 UTC
(
hide
)
Description:
patch for wpa_cli.sh
Filename:
MIME Type:
Creator:
Justin Bronder (RETIRED)
Created:
2009-08-26 21:08:23 UTC
Size:
1.78 KB
patch
obsolete
>diff --git a/net-wireless/wpa_supplicant-0.5.7/etc/wpa_supplicant/wpa_cli.sh b/net-wireless/wpa_supplicant-0.5.7/etc/wpa_supplicant/wpa_cli.sh >index d7d340b..9f8879a 100755 >--- a/net-wireless/wpa_supplicant-0.5.7/etc/wpa_supplicant/wpa_cli.sh >+++ b/net-wireless/wpa_supplicant-0.5.7/etc/wpa_supplicant/wpa_cli.sh >@@ -5,6 +5,24 @@ > # Alternatively, this file may be distributed under the terms of the BSD License > # $Header: /var/cvsroot/gentoo-x86/net-wireless/wpa_supplicant/files/wpa_cli.sh,v 1.1 2006/07/11 15:07:16 uberlord Exp $ > >+lockfile='/var/run/wpa_cli.sh-lock' >+get_lock() { >+ while true; do >+ if ( set -o noclobber; echo "$$" > "${lockfile}") 2> /dev/null; then >+ trap 'rm -f "${lockfile}"; exit $?' INT TERM EXIT >+ break >+ else >+ logger -t wpa_cli "$$ Waiting on lock held by $(<${lockfile})" >+ fi >+ /bin/sleep 0.5 >+ done >+} >+ >+release_lock() { >+ rm -f "${lockfile}" >+ trap - INT TERM EXIT >+} >+ > if [ -z "$1" -o -z "$2" ]; then > logger -t wpa_cli "Insufficient parameters" > exit 1 >@@ -27,9 +45,11 @@ fi > case ${ACTION} in > CONNECTED) > EXEC="${EXEC} start" >+ WAIT_FOR_DEPS=true > ;; > DISCONNECTED) > EXEC="${EXEC} stop" >+ WAIT_FOR_DEPS=false > ;; > *) > logger -t wpa_cli "Unknown action ${ACTION}" >@@ -41,5 +61,13 @@ esac > # stopping the interface and a background process - like wpa_cli - is. > export IN_BACKGROUND=true > >-logger -t wpa_cli "interface ${INTERFACE} ${ACTION}" >-${EXEC} || logger -t wpa_cli "executing '${EXEC}' failed" >+logger -t wpa_cli "$$ interface ${INTERFACE} ${ACTION}" >+get_lock >+${EXEC} || logger -t wpa_cli "$$ executing '${EXEC}' failed" >+if [ ${WAIT_FOR_DEPS} == "true" ]; then >+ while /bin/rc-status --nocolor | grep '\[ starting \]'>/dev/null; do >+ /bin/sleep 0.5 >+ done >+fi >+release_lock >+logger -t wpa_cli "$$ Finished processing ${INTERFACE} ${ACTION}"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 282840
: 202355 |
221175