summaryrefslogtreecommitdiffstats
path: root/hooks
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2017-11-03 16:38:18 +0000
committerRoy Marples <roy@marples.name>2017-11-03 16:38:18 +0000
commitb6fa7c46cf8b64b0d147eb154188851e98c781f8 (patch)
tree95b2e04d22370c1dd576ba5b56eb7f6c3376262d /hooks
parentef53a17e01fc25aea22717373afcfcd9e35c85b5 (diff)
downloaddhcpcd-b6fa7c46cf8b64b0d147eb154188851e98c781f8.tar.xz
dhcpcd-run-hooks(8) should not attempt to guess the protocol.
Diffstat (limited to 'hooks')
-rw-r--r--hooks/01-test3
-rw-r--r--hooks/dhcpcd-run-hooks.8.in4
-rw-r--r--hooks/dhcpcd-run-hooks.in17
3 files changed, 6 insertions, 18 deletions
diff --git a/hooks/01-test b/hooks/01-test
index d4cf8281..6732af79 100644
--- a/hooks/01-test
+++ b/hooks/01-test
@@ -1,7 +1,8 @@
# Echo the interface flags, reason and message options
if [ "$reason" = "TEST" ]; then
- set | grep "^\(interface\|pid\|reason\|profile\|skip_hooks\)=" | sort
+ set | grep \
+ "^\(interface\|pid\|reason\|protocol\|profile\|skip_hooks\)=" | sort
set | grep "^if\(carrier\|flags\|mtu\|wireless\|ssid\)=" | sort
set | grep "^\(new_\|old_\|nd[0-9]*_\)" | sort
exit 0
diff --git a/hooks/dhcpcd-run-hooks.8.in b/hooks/dhcpcd-run-hooks.8.in
index b4b1d301..3b4f2893 100644
--- a/hooks/dhcpcd-run-hooks.8.in
+++ b/hooks/dhcpcd-run-hooks.8.in
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd January 23, 2017
+.Dd November 3, 2017
.Dt DHCPCD-RUN-HOOKS 8
.Os
.Sh NAME
@@ -139,6 +139,8 @@ ones.
.Bl -tag -width xnew_delegated_dhcp6_prefix
.It Ev $interface
the name of the interface.
+.It Ev $protocol
+the protocol that triggered the event.
.It Ev $reason
as described above.
.It Ev $pid
diff --git a/hooks/dhcpcd-run-hooks.in b/hooks/dhcpcd-run-hooks.in
index ba882abb..c1d01256 100644
--- a/hooks/dhcpcd-run-hooks.in
+++ b/hooks/dhcpcd-run-hooks.in
@@ -2,22 +2,7 @@
# dhcpcd client configuration script
# 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"
-
+ifname="$interface${protocol+.}$protocol"
from=from
signature_base="# Generated by dhcpcd"
signature="$signature_base $from $ifname"