diff options
author | 2012-04-19 14:48:44 +0000 | |
---|---|---|
committer | 2012-04-19 14:48:44 +0000 | |
commit | 3cc2d6a393e44b62729e79a8c2cc0fae0caab0fe (patch) | |
tree | e3156c5692860a248753f021fa3b68ca154a3320 | |
parent | small cleanup(%hd -> %d) (diff) | |
download | wireguard-openbsd-3cc2d6a393e44b62729e79a8c2cc0fae0caab0fe.tar.xz wireguard-openbsd-3cc2d6a393e44b62729e79a8c2cc0fae0caab0fe.zip |
relayd re-uses the event callbacks and passes the value of iev.data
as the third argument (so that should be a copy of the 5th argument
of event_set(). it boggles the mind.
-rw-r--r-- | usr.sbin/relayd/control.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/relayd/control.c b/usr.sbin/relayd/control.c index 345bffe59a8..275dd925713 100644 --- a/usr.sbin/relayd/control.c +++ b/usr.sbin/relayd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.42 2012/04/11 08:33:53 deraadt Exp $ */ +/* $OpenBSD: control.c,v 1.43 2012/04/19 14:48:44 deraadt Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -175,6 +175,7 @@ control_accept(int listenfd, short event, void *arg) imsg_init(&c->iev.ibuf, connfd); c->iev.handler = control_dispatch_imsg; c->iev.events = EV_READ; + c->iev.data = cs; /* proc.c cheats (reuses the handler) */ event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events, c->iev.handler, cs); event_add(&c->iev.ev, NULL); @@ -223,7 +224,7 @@ control_close(int fd, struct control_sock *cs) void control_dispatch_imsg(int fd, short event, void *arg) { - struct control_sock *cs = (struct control_sock *)arg; + struct control_sock *cs = arg; struct ctl_conn *c; struct imsg imsg; struct ctl_id id; |