summaryrefslogtreecommitdiff
path: root/usr.sbin/ripd/control.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-11-02 20:28:50 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-11-02 20:28:50 +0000
commit73e30d30e9303ec154a841cb0fc722fe96b77344 (patch)
tree1f5cf5ff94951dcc0e3b1c65f7478873ff52c8d8 /usr.sbin/ripd/control.c
parent650f5a556835c74a288fb331fe461b0abb0ca910 (diff)
Another routing daemon that gets IMSG_CTL_LOG_VERBOSE to allow toggeling of
log_debug(). ok michele, henning, sthen
Diffstat (limited to 'usr.sbin/ripd/control.c')
-rw-r--r--usr.sbin/ripd/control.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.sbin/ripd/control.c b/usr.sbin/ripd/control.c
index 917ecb5dfaf..27751ace744 100644
--- a/usr.sbin/ripd/control.c
+++ b/usr.sbin/ripd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.10 2009/06/06 08:20:55 eric Exp $ */
+/* $OpenBSD: control.c,v 1.11 2009/11/02 20:28:48 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -192,6 +192,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
struct imsg imsg;
ssize_t n;
unsigned int ifidx;
+ int verbose;
if ((c = control_connbyfd(fd)) == NULL) {
log_warn("control_dispatch_imsg: fd %d: not found", fd);
@@ -254,6 +255,20 @@ control_dispatch_imsg(int fd, short event, void *bula)
c->iev.ibuf.pid = imsg.hdr.pid;
ripe_imsg_compose_parent(imsg.hdr.type, 0, NULL, 0);
break;
+ case IMSG_CTL_LOG_VERBOSE:
+ if (imsg.hdr.len != IMSG_HEADER_SIZE +
+ sizeof(verbose))
+ break;
+
+ /* forward to other porcesses */
+ ripe_imsg_compose_parent(imsg.hdr.type, imsg.hdr.pid,
+ imsg.data, imsg.hdr.len - IMSG_HEADER_SIZE);
+ ripe_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);