summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospfd/ospfd.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2009-11-02 20:20:54 +0000
committerclaudio <claudio@openbsd.org>2009-11-02 20:20:54 +0000
commit636d06c3c3c72c74ae6d3c17bf98c92b0296f35c (patch)
tree49e1b858bb0816ec8003450707789c3d2c32f46c /usr.sbin/ospfd/ospfd.c
parentDouble the escape timer (the time after a \033 is received before tmux gives up (diff)
downloadwireguard-openbsd-636d06c3c3c72c74ae6d3c17bf98c92b0296f35c.tar.xz
wireguard-openbsd-636d06c3c3c72c74ae6d3c17bf98c92b0296f35c.zip
Implement IMSG_CTL_LOG_VERBOSE to enable or disable debug logging on runtime.
It always annoyed me that in case of a problem I had to restart the ospf in forground debug mode and by doing so losing all routes at least twice. OK henning, sthen, michele
Diffstat (limited to 'usr.sbin/ospfd/ospfd.c')
-rw-r--r--usr.sbin/ospfd/ospfd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c
index 51ca0fc552d..0150308db5f 100644
--- a/usr.sbin/ospfd/ospfd.c
+++ b/usr.sbin/ospfd/ospfd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfd.c,v 1.70 2009/06/06 07:31:26 eric Exp $ */
+/* $OpenBSD: ospfd.c,v 1.71 2009/11/02 20:20:54 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -166,8 +166,8 @@ main(int argc, char *argv[])
if (opts & OSPFD_OPT_VERBOSE)
opts |= OSPFD_OPT_VERBOSE2;
opts |= OSPFD_OPT_VERBOSE;
+ log_verbose(1);
break;
-
default:
usage();
/* NOTREACHED */
@@ -367,7 +367,7 @@ main_dispatch_ospfe(int fd, short event, void *bula)
struct imsg imsg;
struct demote_msg dmsg;
ssize_t n;
- int shut = 0;
+ int shut = 0, verbose;
ibuf = &iev->ibuf;
@@ -420,6 +420,11 @@ main_dispatch_ospfe(int fd, short event, void *bula)
memcpy(&dmsg, imsg.data, sizeof(dmsg));
carp_demote_set(dmsg.demote_group, dmsg.level);
break;
+ case IMSG_CTL_LOG_VERBOSE:
+ /* already checked by ospfe */
+ memcpy(&verbose, imsg.data, sizeof(verbose));
+ log_verbose(verbose);
+ break;
default:
log_debug("main_dispatch_ospfe: error handling imsg %d",
imsg.hdr.type);