On Mon, Jul 09, 2018 at 10:42:16AM +0200, Claudio Jeker wrote:
> On Mon, Jul 09, 2018 at 10:31:15AM +0200, Remi Locherer wrote:
> > later on it is set with:
> > log_setverbose(ospfd_conf->opts & OSPFD_OPT_VERBOSE);
> >
> > OK?
>
> Shouldn't we instead remove the log_setverbose(1) above the getopt call?
> I think the idea is that we want to be able to print debug messages
> between the early log_init() and the later one.
> In general that will allow debugging in parse_config() if -v is used.
Yes, this makes sense to me. Also adapt ospfd.
OK?
Index: ospf6d/ospf6d.c
===================================================================
RCS file: /cvs/src/usr.sbin/ospf6d/ospf6d.c,v
retrieving revision 1.35
diff -u -p -r1.35 ospf6d.c
--- ospf6d/ospf6d.c 5 Nov 2017 16:56:02 -0000 1.35
+++ ospf6d/ospf6d.c 9 Jul 2018 09:22:54 -0000
@@ -121,7 +121,6 @@ main(int argc, char *argv[])
log_init(1, LOG_DAEMON); /* log to stderr until daemonized */
log_procinit(log_procnames[ospfd_process]);
- log_setverbose(1);
while ((ch = getopt(argc, argv, "cdD:f:s:nv")) != -1) {
switch (ch) {
Index: ospfd/ospfd.c
===================================================================
RCS file: /cvs/src/usr.sbin/ospfd/ospfd.c,v
retrieving revision 1.97
diff -u -p -r1.97 ospfd.c
--- ospfd/ospfd.c 11 Feb 2018 02:27:33 -0000 1.97
+++ ospfd/ospfd.c 9 Jul 2018 09:26:54 -0000
@@ -123,7 +123,6 @@ main(int argc, char *argv[])
log_init(1, LOG_DAEMON); /* log to stderr until daemonized */
log_procinit(log_procnames[ospfd_process]);
- log_setverbose(1);
while ((ch = getopt(argc, argv, "cdD:f:ns:v")) != -1) {
switch (ch) {
@@ -151,6 +150,7 @@ main(int argc, char *argv[])
if (opts & OSPFD_OPT_VERBOSE)
opts |= OSPFD_OPT_VERBOSE2;
opts |= OSPFD_OPT_VERBOSE;
+ log_setverbose(1);
break;
default:
usage();