summaryrefslogtreecommitdiff
path: root/sbin/dhclient/dispatch.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2017-06-14 20:27:09 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2017-06-14 20:27:09 +0000
commit1498e0654b7bf3976f9170174b8521f243d4d1fe (patch)
treee244fb3ccce98076e1d843f1bbf5ecbf7a869248 /sbin/dhclient/dispatch.c
parent8a17ba6805f280b144fae94dc77afdb82937f077 (diff)
No need to be coy - call a "struct interface_info *" a
"struct interface_info *" and not a "void *". No intentional functional change.
Diffstat (limited to 'sbin/dhclient/dispatch.c')
-rw-r--r--sbin/dhclient/dispatch.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c
index 0891ea8fc99..4138f703f92 100644
--- a/sbin/dhclient/dispatch.c
+++ b/sbin/dhclient/dispatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dispatch.c,v 1.121 2017/06/14 16:52:35 krw Exp $ */
+/* $OpenBSD: dispatch.c,v 1.122 2017/06/14 20:27:08 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -123,15 +123,15 @@ dispatch(struct interface_info *ifi)
int count, to_msec;
struct pollfd fds[3];
time_t cur_time, howlong;
- void (*func)(void *);
- void *arg;
+ void (*func)(struct interface_info *);
+ struct interface_info *arg;
while (quit == 0) {
if (timeout.func) {
time(&cur_time);
if (timeout.when <= cur_time) {
func = timeout.func;
- arg = timeout.arg;
+ arg = timeout.ifi;
cancel_timeout();
(*(func))(arg);
continue;
@@ -155,7 +155,7 @@ dispatch(struct interface_info *ifi)
* fds[0] == bpf socket for incoming packets
* fds[1] == routing socket for incoming RTM messages
* fds[2] == imsg socket to privileged process
- */
+ */
fds[0].fd = ifi->bfdesc;
fds[1].fd = routefd;
fds[2].fd = unpriv_ibuf->fd;
@@ -280,19 +280,21 @@ interface_status(struct interface_info *ifi)
}
void
-set_timeout(time_t when, void (*where)(void *), void *arg)
+set_timeout(time_t when, void (*where)(struct interface_info *),
+ struct interface_info *ifi)
{
timeout.when = when;
timeout.func = where;
- timeout.arg = arg;
+ timeout.ifi = ifi;
}
void
-set_timeout_interval(time_t secs, void (*where)(void *), void *arg)
+set_timeout_interval(time_t secs, void (*where)(struct interface_info *),
+ struct interface_info *ifi)
{
timeout.when = time(NULL) + secs;
timeout.func = where;
- timeout.arg = arg;
+ timeout.ifi = ifi;
}
void
@@ -300,7 +302,7 @@ cancel_timeout(void)
{
timeout.when = 0;
timeout.func = NULL;
- timeout.arg = NULL;
+ timeout.ifi = NULL;
}
int