summaryrefslogtreecommitdiff
path: root/usr.sbin/snmpctl
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2011-03-16 15:30:36 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2011-03-16 15:30:36 +0000
commit070492cde76e006f968fb3d99342a0bf38cf7c41 (patch)
tree3da50e122d55d8e9475801c6375061e56fd55cbc /usr.sbin/snmpctl
parenta2c088b5a47c7cd7e3cb3d547707b260050c61c5 (diff)
fix trap sending in snmpd by adjusting snmpctl to the imsg libutil
change and fixing the ber element handling in snmpd itself. tested by jsg@
Diffstat (limited to 'usr.sbin/snmpctl')
-rw-r--r--usr.sbin/snmpctl/snmpctl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/snmpctl/snmpctl.c b/usr.sbin/snmpctl/snmpctl.c
index af93f91208f..f41198d22c3 100644
--- a/usr.sbin/snmpctl/snmpctl.c
+++ b/usr.sbin/snmpctl/snmpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpctl.c,v 1.12 2009/12/16 22:17:53 deraadt Exp $ */
+/* $OpenBSD: snmpctl.c,v 1.13 2011/03/16 15:30:35 reyk Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@vantronix.net>
@@ -148,12 +148,14 @@ main(int argc, char *argv[])
err(1, "connect: %s", sock);
}
- if (res->ibuf != NULL)
+ if (res->ibuf != NULL) {
ibuf = res->ibuf;
- else
+ ibuf->fd = ibuf->w.fd = ctl_sock;
+ } else {
if ((ibuf = malloc(sizeof(struct imsgbuf))) == NULL)
err(1, "malloc");
- imsg_init(ibuf, ctl_sock);
+ imsg_init(ibuf, ctl_sock);
+ }
done = 0;
/* process user request */