summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpf <mpf@openbsd.org>2008-06-13 23:29:31 +0000
committermpf <mpf@openbsd.org>2008-06-13 23:29:31 +0000
commit7bd45c0ae89416e67f389eefbbe82d7f69c7bf26 (patch)
tree04ff7b7bfbc8228fc2f7ed79801ab3b3a5c3ed50
parentMove the responsibility to free received packets on trunked interfaces (diff)
downloadwireguard-openbsd-7bd45c0ae89416e67f389eefbbe82d7f69c7bf26.tar.xz
wireguard-openbsd-7bd45c0ae89416e67f389eefbbe82d7f69c7bf26.zip
Do not log carp state transitions from or to INIT by default.
Reduces the amount of dmesg noise. Tested and OK mcbride@
-rw-r--r--sys/netinet/ip_carp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 186431bf273..ca82bcf5c9f 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.165 2008/06/09 07:07:16 djm Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.166 2008/06/13 23:29:31 mpf Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -2475,16 +2475,21 @@ carp_set_state(struct carp_vhost_entry *vhe, int state)
{
struct carp_softc *sc = vhe->parent_sc;
static const char *carp_states[] = { CARP_STATES };
+ int loglevel;
if (vhe->state == state)
return;
+ if (vhe->state == INIT || state == INIT)
+ loglevel = LOG_WARNING;
+ else
+ loglevel = LOG_CRIT;
if (sc->sc_vhe_count > 1)
- CARP_LOG(LOG_CRIT, sc,
+ CARP_LOG(loglevel, sc,
("state transition (vhid %d): %s -> %s", vhe->vhid,
carp_states[vhe->state], carp_states[state]));
else
- CARP_LOG(LOG_CRIT, sc,
+ CARP_LOG(loglevel, sc,
("state transition: %s -> %s",
carp_states[vhe->state], carp_states[state]));