diff options
author | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2012-11-29 14:53:25 +0000 |
---|---|---|
committer | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2012-11-29 14:53:25 +0000 |
commit | 61a5037d0d5b16a1ed89511e0ee1752c432523e4 (patch) | |
tree | b5679b4ef154728b07f3753d644a60e596244019 | |
parent | f60c3c6929b68d0f0942c42dd8ca1b1a4ec1c70a (diff) |
Wrong argument was passed to control_dispatch_imsg(). Use always
(struct imsgev *)->data for the argument of imsgev handlers.
ok reyk
-rw-r--r-- | usr.sbin/snmpd/control.c | 3 | ||||
-rw-r--r-- | usr.sbin/snmpd/snmpd.c | 5 | ||||
-rw-r--r-- | usr.sbin/snmpd/snmpe.c | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/snmpd/control.c b/usr.sbin/snmpd/control.c index d28a772c430..29cba914e62 100644 --- a/usr.sbin/snmpd/control.c +++ b/usr.sbin/snmpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.16 2012/09/18 08:29:09 reyk Exp $ */ +/* $OpenBSD: control.c,v 1.17 2012/11/29 14:53:24 yasuoka Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -173,6 +173,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; event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events, c->iev.handler, cs); event_add(&c->iev.ev, NULL); diff --git a/usr.sbin/snmpd/snmpd.c b/usr.sbin/snmpd/snmpd.c index 75775982de4..57aaeebf317 100644 --- a/usr.sbin/snmpd/snmpd.c +++ b/usr.sbin/snmpd/snmpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snmpd.c,v 1.14 2012/09/18 08:29:09 reyk Exp $ */ +/* $OpenBSD: snmpd.c,v 1.15 2012/11/29 14:53:24 yasuoka Exp $ */ /* * Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org> @@ -210,6 +210,7 @@ main(int argc, char *argv[]) imsg_init(&iev_snmpe->ibuf, pipe_parent2snmpe[0]); iev_snmpe->handler = snmpd_dispatch_snmpe; + iev_snmpe->data = iev_snmpe; iev_snmpe->events = EV_READ; event_set(&iev_snmpe->ev, iev_snmpe->ibuf.fd, iev_snmpe->events, @@ -269,7 +270,7 @@ imsg_event_add(struct imsgev *iev) iev->events |= EV_WRITE; event_del(&iev->ev); - event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev); + event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data); event_add(&iev->ev, NULL); } diff --git a/usr.sbin/snmpd/snmpe.c b/usr.sbin/snmpd/snmpe.c index b2fd468dfa4..89a9804dbdb 100644 --- a/usr.sbin/snmpd/snmpe.c +++ b/usr.sbin/snmpd/snmpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snmpe.c,v 1.31 2012/09/18 08:29:09 reyk Exp $ */ +/* $OpenBSD: snmpe.c,v 1.32 2012/11/29 14:53:24 yasuoka Exp $ */ /* * Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org> @@ -145,6 +145,7 @@ snmpe(struct snmpd *x_env, int pipe_parent2snmpe[2]) imsg_init(&iev_parent->ibuf, pipe_parent2snmpe[1]); iev_parent->handler = snmpe_dispatch_parent; + iev_parent->data = iev_parent; iev_parent->events = EV_READ; event_set(&iev_parent->ev, iev_parent->ibuf.fd, iev_parent->events, |