void-packages/srcpkgs/dhcpcd/patches/wpa-hook-stop.patch

47 lines
1.2 KiB
Diff
Raw Normal View History

--- dhcpcd-run-hooks.in.orig 2014-11-26 16:34:35.000000000 +0100
+++ dhcpcd-run-hooks.in 2014-11-28 11:53:13.712853795 +0100
@@ -2,13 +2,20 @@
# dhcpcd client configuration script
# Handy variables and functions for our hooks to use
+: ${if_up:=false}
+: ${if_down:=false}
+: ${syslog_debug:=false}
+
case "$reason" in
ROUTERADVERT)
ifsuffix=":ra";;
INFORM6|BOUND6|RENEW6|REBIND6|REBOOT6|EXPIRE6|RELEASE6|STOP6)
ifsuffix=":dhcp6";;
- STOPPED) # This reason should never be processed
- exit 0;;
+ STOPPED) # Only process this reason if iface is down.
+ if [ "$if_up" != "false" -o "$if_down" = "false" ]; then
+ exit 0
+ fi
+ ;;
*)
ifsuffix=;;
esac
@@ -22,10 +29,6 @@ signature_end="$signature_base_end $from
state_dir=@RUNDIR@/dhcpcd
_detected_init=false
-: ${if_up:=false}
-: ${if_down:=false}
-: ${syslog_debug:=false}
-
# Ensure that all arguments are unique
uniqify()
{
--- dhcpcd-hooks/10-wpa_supplicant.orig 2014-11-26 16:34:35.000000000 +0100
+++ dhcpcd-hooks/10-wpa_supplicant 2014-11-28 11:53:48.929217243 +0100
@@ -114,6 +114,6 @@ then
case "$reason" in
PREINIT) wpa_supplicant_start;;
RECONFIGURE) wpa_supplicant_reconfigure;;
- DEPARTED) wpa_supplicant_stop;;
+ DEPARTED|STOPPED) wpa_supplicant_stop;;
esac
fi