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
# 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"