diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-11-02 20:31:51 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-11-02 20:31:51 +0000 |
commit | ed31761bb62c868fc5ed347842ab1a928609ce9c (patch) | |
tree | 6d411297920f6e9d0636e9e5209c0855ea24d0fa /usr.sbin/dvmrpd/control.c | |
parent | 0b0b1baf26e53c033ac0be651cf6100e3ed7b97a (diff) |
Yet another implementation of IMSG_CTL_LOG_VERBOSE. Similar to the one in
ripd, ospfd and friends. OK michele, henning, sthen
Diffstat (limited to 'usr.sbin/dvmrpd/control.c')
-rw-r--r-- | usr.sbin/dvmrpd/control.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.sbin/dvmrpd/control.c b/usr.sbin/dvmrpd/control.c index a99e46be4b4..27c04a7040a 100644 --- a/usr.sbin/dvmrpd/control.c +++ b/usr.sbin/dvmrpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.8 2009/06/06 07:52:04 pyr Exp $ */ +/* $OpenBSD: control.c,v 1.9 2009/11/02 20:31:50 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -193,6 +193,7 @@ control_dispatch_imsg(int fd, short event, void *bula) struct imsg imsg; int n; unsigned int ifidx; + int verbose; if ((c = control_connbyfd(fd)) == NULL) { log_warn("control_dispatch_imsg: fd %d: not found", fd); @@ -255,6 +256,20 @@ control_dispatch_imsg(int fd, short event, void *bula) dvmrpe_imsg_compose_rde(imsg.hdr.type, 0, imsg.hdr.pid, imsg.data, imsg.hdr.len - IMSG_HEADER_SIZE); break; + case IMSG_CTL_LOG_VERBOSE: + if (imsg.hdr.len != IMSG_HEADER_SIZE + + sizeof(verbose)) + break; + + /* forward to other porcesses */ + dvmrpe_imsg_compose_parent(imsg.hdr.type, imsg.hdr.pid, + imsg.data, imsg.hdr.len - IMSG_HEADER_SIZE); + dvmrpe_imsg_compose_rde(imsg.hdr.type, 0, imsg.hdr.pid, + imsg.data, imsg.hdr.len - IMSG_HEADER_SIZE); + + memcpy(&verbose, imsg.data, sizeof(verbose)); + log_verbose(verbose); + break; default: log_debug("control_dispatch_imsg: " "error handling imsg %d", imsg.hdr.type); |