diff options
Diffstat (limited to 'usr.sbin/snmpd/control.c')
-rw-r--r-- | usr.sbin/snmpd/control.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/snmpd/control.c b/usr.sbin/snmpd/control.c index 24023e798c5..a048f652fa5 100644 --- a/usr.sbin/snmpd/control.c +++ b/usr.sbin/snmpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.1 2007/12/05 09:22:44 reyk Exp $ */ +/* $OpenBSD: control.c,v 1.2 2008/01/16 09:36:30 reyk Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -230,6 +230,16 @@ control_dispatch_imsg(int fd, short event, void *arg) } c->flags |= CTL_CONN_NOTIFY; break; + case IMSG_SNMP_TRAP: + if (snmpe_trap(&c->ibuf, imsg.hdr.pid) == -1) { + log_debug("control_dispatch_imsg: " + "received invalid trap (pid %d)", + imsg.hdr.pid); + imsg_free(&imsg); + control_close(fd); + return; + } + break; default: log_debug("control_dispatch_imsg: " "error handling imsg %d", imsg.hdr.type); |