diff options
Diffstat (limited to 'usr.sbin/ospf6d/control.c')
-rw-r--r-- | usr.sbin/ospf6d/control.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/usr.sbin/ospf6d/control.c b/usr.sbin/ospf6d/control.c index 7ecdd792aa3..ad372a6822b 100644 --- a/usr.sbin/ospf6d/control.c +++ b/usr.sbin/ospf6d/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.10 2009/06/06 09:02:46 eric Exp $ */ +/* $OpenBSD: control.c,v 1.11 2009/11/02 20:24:58 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -191,6 +191,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); @@ -231,9 +232,8 @@ control_dispatch_imsg(int fd, short event, void *bula) case IMSG_CTL_KROUTE: case IMSG_CTL_KROUTE_ADDR: c->iev.ibuf.pid = imsg.hdr.pid; - ospfe_imsg_compose_parent(imsg.hdr.type, - imsg.hdr.pid, imsg.data, - imsg.hdr.len - IMSG_HEADER_SIZE); + ospfe_imsg_compose_parent(imsg.hdr.type, imsg.hdr.pid, + imsg.data, imsg.hdr.len - IMSG_HEADER_SIZE); break; case IMSG_CTL_SHOW_INTERFACE: if (imsg.hdr.len == IMSG_HEADER_SIZE + @@ -262,6 +262,20 @@ control_dispatch_imsg(int fd, short event, void *bula) case IMSG_CTL_SHOW_NBR: ospfe_nbr_ctl(c); break; + case IMSG_CTL_LOG_VERBOSE: + if (imsg.hdr.len != IMSG_HEADER_SIZE + + sizeof(verbose)) + break; + + /* forward to other porcesses */ + ospfe_imsg_compose_parent(imsg.hdr.type, imsg.hdr.pid, + imsg.data, imsg.hdr.len - IMSG_HEADER_SIZE); + ospfe_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); |