summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Wooding <kjell@cvs.openbsd.org>2010-06-29 18:10:05 +0000
committerKjell Wooding <kjell@cvs.openbsd.org>2010-06-29 18:10:05 +0000
commit4475f8e88b30b4fc82c56ae193a287deb3d0cab0 (patch)
tree0dab6e8e66aacea2f94d8576cea87eef8d058aed
parent8fb5483d61dbd0bea53ce6f41464a8ae8df6d65c (diff)
Having more than 2 log levels is silly. Use only 3 verbosity levels:
None (), Important (-v), All (-vv) ok deraadt@
-rw-r--r--usr.sbin/sasyncd/monitor.c4
-rw-r--r--usr.sbin/sasyncd/net.c32
-rw-r--r--usr.sbin/sasyncd/net_ctl.c10
-rw-r--r--usr.sbin/sasyncd/pfkey.c14
-rw-r--r--usr.sbin/sasyncd/timer.c6
5 files changed, 33 insertions, 33 deletions
diff --git a/usr.sbin/sasyncd/monitor.c b/usr.sbin/sasyncd/monitor.c
index 613af4d60d6..411af05af39 100644
--- a/usr.sbin/sasyncd/monitor.c
+++ b/usr.sbin/sasyncd/monitor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor.c,v 1.13 2010/06/16 17:39:05 reyk Exp $ */
+/* $OpenBSD: monitor.c,v 1.14 2010/06/29 18:10:04 kjell Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -321,7 +321,7 @@ monitor_get_pfkey_snap(u_int8_t **sadb, u_int32_t *sadbsize, u_int8_t **spd,
}
}
- log_msg(3, "monitor_get_pfkey_snap: got %u bytes SADB, %u bytes SPD",
+ log_msg(2, "monitor_get_pfkey_snap: got %u bytes SADB, %u bytes SPD",
*sadbsize, *spdsize);
return 0;
}
diff --git a/usr.sbin/sasyncd/net.c b/usr.sbin/sasyncd/net.c
index b70c8c4e845..4bd32b73662 100644
--- a/usr.sbin/sasyncd/net.c
+++ b/usr.sbin/sasyncd/net.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: net.c,v 1.15 2007/01/08 15:31:01 markus Exp $ */
+/* $OpenBSD: net.c,v 1.16 2010/06/29 18:10:04 kjell Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -140,10 +140,10 @@ net_add_listener(struct sockaddr *sa)
if (getnameinfo(sa, sa->sa_len, host, sizeof host, port, sizeof port,
NI_NUMERICHOST | NI_NUMERICSERV))
- log_msg(3, "listening on port %u fd %d", cfgstate.listen_port,
+ log_msg(2, "listening on port %u fd %d", cfgstate.listen_port,
s);
else
- log_msg(3, "listening on %s port %s fd %d", host, port, s);
+ log_msg(2, "listening on %s port %s fd %d", host, port, s);
return s;
}
@@ -249,7 +249,7 @@ net_setup_listeners(void)
listeners[count] = net_add_listener(sa);
if (listeners[count] == -1) {
- log_msg(4, "net_setup_listeners(setup): failed to "
+ log_msg(2, "net_setup_listeners(setup): failed to "
"add listener, count = %d", count);
goto errout;
}
@@ -342,7 +342,7 @@ net_queue(struct syncpeer *p0, u_int32_t msgtype, u_int8_t *buf, u_int32_t len)
SHA1_Init(&ctx);
SHA1_Update(&ctx, buf, len);
SHA1_Final(hash, &ctx);
- dump_buf(5, hash, sizeof hash, "net_queue: computed hash");
+ dump_buf(2, hash, sizeof hash, "net_queue: computed hash");
/* Padding required? */
i = len % AES_IV_LEN;
@@ -367,13 +367,13 @@ net_queue(struct syncpeer *p0, u_int32_t msgtype, u_int8_t *buf, u_int32_t len)
v = arc4random();
memcpy(&iv[i], &v, sizeof v);
}
- dump_buf(5, iv, sizeof iv, "net_queue: IV");
+ dump_buf(2, iv, sizeof iv, "net_queue: IV");
memcpy(tmp_iv, iv, sizeof tmp_iv);
/* Encrypt */
- dump_buf(5, buf, len, "net_queue: pre encrypt");
+ dump_buf(2, buf, len, "net_queue: pre encrypt");
AES_cbc_encrypt(buf, buf, len, &aes_key[0], tmp_iv, AES_ENCRYPT);
- dump_buf(5, buf, len, "net_queue: post encrypt");
+ dump_buf(2, buf, len, "net_queue: post encrypt");
/* Allocate send buffer */
m->len = len + sizeof iv + sizeof hash + 3 * sizeof(u_int32_t);
@@ -534,7 +534,7 @@ net_handle_messages(fd_set *fds)
if (!msg)
continue;
- log_msg(5, "net_handle_messages: got msg type %u len %u from "
+ log_msg(2, "net_handle_messages: got msg type %u len %u from "
"peer %s", msgtype, msglen, p->name);
switch (msgtype) {
@@ -584,7 +584,7 @@ net_send_messages(fd_set *fds)
}
m = qm->msg;
- log_msg(5, "net_send_messages: msg %p len %u ref %d "
+ log_msg(2, "net_send_messages: msg %p len %u ref %d "
"to peer %s", m, m->len, m->refcnt, p->name);
/* write message */
@@ -603,7 +603,7 @@ net_send_messages(fd_set *fds)
free(qm);
if (--m->refcnt < 1) {
- log_msg(5, "net_send_messages: freeing msg %p", m);
+ log_msg(2, "net_send_messages: freeing msg %p", m);
free(m->buf);
free(m);
}
@@ -731,17 +731,17 @@ net_read(struct syncpeer *p, u_int32_t *msgtype, u_int32_t *msglen)
}
memcpy(msg, iv + AES_IV_LEN, *msglen);
- dump_buf(5, rhash, sizeof hash, "net_read: got hash");
- dump_buf(5, iv, AES_IV_LEN, "net_read: got IV");
- dump_buf(5, msg, *msglen, "net_read: pre decrypt");
+ dump_buf(2, rhash, sizeof hash, "net_read: got hash");
+ dump_buf(2, iv, AES_IV_LEN, "net_read: got IV");
+ dump_buf(2, msg, *msglen, "net_read: pre decrypt");
AES_cbc_encrypt(msg, msg, *msglen, &aes_key[1], iv, AES_DECRYPT);
- dump_buf(5, msg, *msglen, "net_read: post decrypt");
+ dump_buf(2, msg, *msglen, "net_read: post decrypt");
*msglen -= padlen;
SHA1_Init(&ctx);
SHA1_Update(&ctx, msg, *msglen);
SHA1_Final(hash, &ctx);
- dump_buf(5, hash, sizeof hash, "net_read: computed hash");
+ dump_buf(2, hash, sizeof hash, "net_read: computed hash");
if (memcmp(hash, rhash, sizeof hash) != 0) {
free(blob);
diff --git a/usr.sbin/sasyncd/net_ctl.c b/usr.sbin/sasyncd/net_ctl.c
index fcd346a0ad5..d79052259fc 100644
--- a/usr.sbin/sasyncd/net_ctl.c
+++ b/usr.sbin/sasyncd/net_ctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: net_ctl.c,v 1.8 2006/06/02 20:09:43 mcbride Exp $ */
+/* $OpenBSD: net_ctl.c,v 1.9 2010/06/29 18:10:04 kjell Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -92,7 +92,7 @@ net_ctl_handle_msg(struct syncpeer *p, u_int8_t *msg, u_int32_t msglen)
switch (ntohl(ctl->type)) {
case CTL_ENDSNAP:
- log_msg(4, "net_ctl: got CTL_ENDSNAP from peer \"%s\"",
+ log_msg(2, "net_ctl: got CTL_ENDSNAP from peer \"%s\"",
p->name);
/* XXX More sophistication required to handle multiple peers. */
@@ -104,7 +104,7 @@ net_ctl_handle_msg(struct syncpeer *p, u_int8_t *msg, u_int32_t msglen)
break;
case CTL_STATE:
- log_msg(4, "net_ctl: got CTL_STATE from peer \"%s\"", p->name);
+ log_msg(2, "net_ctl: got CTL_STATE from peer \"%s\"", p->name);
nstate = (enum RUNSTATE)ntohl(ctl->data);
if (net_ctl_check_state(p, nstate) == 0)
net_ctl_send_ack(p, CTL_STATE, cfgstate.runstate);
@@ -136,7 +136,7 @@ net_ctl_handle_msg(struct syncpeer *p, u_int8_t *msg, u_int32_t msglen)
ct = "<unknown>";
else
ct = ctltype[ctype];
- log_msg(4, "net_ctl: got %s ACK from peer \"%s\"", ct,
+ log_msg(2, "net_ctl: got %s ACK from peer \"%s\"", ct,
p->name);
if (ctype == CTL_STATE) {
nstate = (enum RUNSTATE)ntohl(ctl->data2);
@@ -206,7 +206,7 @@ net_ctl_update_state(void)
for (p = LIST_FIRST(&cfgstate.peerlist); p; p = LIST_NEXT(p, link)) {
if (p->socket == -1)
continue;
- log_msg(4, "net_ctl: sending my state %s to peer \"%s\"",
+ log_msg(2, "net_ctl: sending my state %s to peer \"%s\"",
carp_state_name(cfgstate.runstate), p->name);
net_ctl_send_state(p);
}
diff --git a/usr.sbin/sasyncd/pfkey.c b/usr.sbin/sasyncd/pfkey.c
index 35431656f28..993ee1f4719 100644
--- a/usr.sbin/sasyncd/pfkey.c
+++ b/usr.sbin/sasyncd/pfkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkey.c,v 1.19 2007/09/02 15:19:40 deraadt Exp $ */
+/* $OpenBSD: pfkey.c,v 1.20 2010/06/29 18:10:04 kjell Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -123,7 +123,7 @@ pfkey_send_flush(struct syncpeer *p)
m->sadb_msg_pid = getpid();
m->sadb_msg_len = sizeof *m / CHUNK;
- log_msg(3, "pfkey_send_flush: sending FLUSH to peer %s",
+ log_msg(2, "pfkey_send_flush: sending FLUSH to peer %s",
p->name);
net_queue(p, MSG_PFKEYDATA, (u_int8_t *)m, sizeof *m);
}
@@ -425,7 +425,7 @@ pfkey_queue_message(u_int8_t *data, u_int32_t datalen)
sadb->sadb_msg_pid = getpid();
sadb->sadb_msg_seq = seq++;
- log_msg(3, "pfkey_queue_message: pfkey %s len %u seq %u",
+ log_msg(2, "pfkey_queue_message: pfkey %s len %u seq %u",
pfkey_print_type(sadb), sadb->sadb_msg_len * CHUNK,
sadb->sadb_msg_seq);
@@ -472,7 +472,7 @@ pfkey_snapshot(void *v)
/* Parse SADB data */
if (sadbsz && sadb) {
- dump_buf(3, sadb, sadbsz, "pfkey_snapshot: SADB data");
+ dump_buf(2, sadb, sadbsz, "pfkey_snapshot: SADB data");
max = sadb + sadbsz;
for (next = sadb; next < max;
next += m->sadb_msg_len * CHUNK) {
@@ -492,7 +492,7 @@ pfkey_snapshot(void *v)
memcpy(sendbuf, m, m->sadb_msg_len * CHUNK);
net_queue(p, MSG_PFKEYDATA, sendbuf,
m->sadb_msg_len * CHUNK);
- log_msg(3, "pfkey_snapshot: sync SA %p len %u "
+ log_msg(2, "pfkey_snapshot: sync SA %p len %u "
"to peer %s", m,
m->sadb_msg_len * CHUNK, p->name);
}
@@ -503,7 +503,7 @@ pfkey_snapshot(void *v)
/* Parse SPD data */
if (spdsz && spd) {
- dump_buf(3, spd, spdsz, "pfkey_snapshot: SPD data");
+ dump_buf(2, spd, spdsz, "pfkey_snapshot: SPD data");
max = spd + spdsz;
for (next = spd; next < max; next += m->sadb_msg_len * CHUNK) {
m = (struct sadb_msg *)next;
@@ -522,7 +522,7 @@ pfkey_snapshot(void *v)
memcpy(sendbuf, m, m->sadb_msg_len * CHUNK);
net_queue(p, MSG_PFKEYDATA, sendbuf,
m->sadb_msg_len * CHUNK);
- log_msg(3, "pfkey_snapshot: sync FLOW %p len "
+ log_msg(2, "pfkey_snapshot: sync FLOW %p len "
"%u to peer %s", m,
m->sadb_msg_len * CHUNK, p->name);
}
diff --git a/usr.sbin/sasyncd/timer.c b/usr.sbin/sasyncd/timer.c
index d4726f3dc42..86aaa3df271 100644
--- a/usr.sbin/sasyncd/timer.c
+++ b/usr.sbin/sasyncd/timer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: timer.c,v 1.3 2006/06/02 20:31:48 moritz Exp $ */
+/* $OpenBSD: timer.c,v 1.4 2010/06/29 18:10:04 kjell Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -97,7 +97,7 @@ timer_run(void)
for (e = TAILQ_FIRST(&events); e && timercmp(&now, &e->expire, >=);
e = TAILQ_FIRST(&events)) {
TAILQ_REMOVE(&events, e, next);
- log_msg(6, "timer_run: event \"%s\"",
+ log_msg(2, "timer_run: event \"%s\"",
e->name ? e->name : "<unknown>");
(*e->fun)(e->arg);
if (e->name)
@@ -128,7 +128,7 @@ timer_add(char *name, u_int32_t when, void (*function)(void *), void *arg)
gettimeofday(&now, 0);
timeradd(&now, &tmp, &new->expire);
- log_msg(6, "timer_add: new event \"%s\" (expiring in %us)",
+ log_msg(2, "timer_add: new event \"%s\" (expiring in %us)",
name ? name : "<unknown>", when);
/* Insert the new event in the queue so it's always sorted. */