diff options
| author | Roy Marples <roy@marples.name> | 2017-07-06 17:13:51 +0100 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2017-07-13 16:25:16 +0100 |
| commit | 34755e92eb1838489b902d77d13c928b6cc8dfea (patch) | |
| tree | 931f6240693340fda3f3ffaa6da3dc8edef3bf72 /hooks | |
| parent | e4623d6580e74c7827f1720e74be638e759e2696 (diff) | |
| download | dhcpcd-34755e92eb1838489b902d77d13c928b6cc8dfea.tar.xz | |
Unset $ifsuffix for non protocol reasons
Summary:
The default was to assume unspecified reasons were DHCP.
This is bad for non protocol events such as NOCARRIER which could
cause a dhcpcd instance running IPv6 only to wipe out the DNS
records created by a separate dhcpcd instance handling IPv4.
Fixes T129.
Test Plan:
Start `dhcpcd -4 -K eth0`.
Observe that a resolvconf entry is created for eth0.dhcp.
Start `dhcpcd -6 eth0`.
Observe that a resolvconf entry is created for eth0.dhcp6.
Bring the carrier down for eth0.
Because the -4 instance is ignoring carrier, it is expected that
the eth0.dhcp resolvconf entry is preserved.
Maniphest Tasks: T129
Differential Revision: https://dev.marples.name/D124
Diffstat (limited to 'hooks')
| -rw-r--r-- | hooks/dhcpcd-run-hooks.in | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hooks/dhcpcd-run-hooks.in b/hooks/dhcpcd-run-hooks.in index 4490fa9b..ba882abb 100644 --- a/hooks/dhcpcd-run-hooks.in +++ b/hooks/dhcpcd-run-hooks.in @@ -3,14 +3,18 @@ # Handy variables and functions for our hooks to use case "$reason" in + PREINIT|CARRIER|NOCARRIER|DEPARTED|STOPPED|DUMP|TEST) + ifsuffix=;; #unset ROUTERADVERT) ifsuffix=".ra";; INFORM6|BOUND6|RENEW6|REBIND6|REBOOT6|EXPIRE6|RELEASE6|STOP6) ifsuffix=".dhcp6";; IPV4LL) ifsuffix=".ipv4ll";; - *) + INFORM|BOUND|RENEW|REBIND|REBOOT|EXPIRE|RELEASE|STOP) ifsuffix=".dhcp";; + *) + ifsuffix=;; #unset esac ifname="$interface$ifsuffix" |
