summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_carp.c
diff options
context:
space:
mode:
authorMarco Pfatschbacher <mpf@cvs.openbsd.org>2008-06-13 23:29:32 +0000
committerMarco Pfatschbacher <mpf@cvs.openbsd.org>2008-06-13 23:29:32 +0000
commit339595afbba046dfcd201cfd7ee9de5a9f19d63e (patch)
treec3b088309f1d026591f2b3405f1eb685fb78d64c /sys/netinet/ip_carp.c
parent2579cb3d1d3c8e93b54546c8463052d4ec2ab4a2 (diff)
Do not log carp state transitions from or to INIT by default.
Reduces the amount of dmesg noise. Tested and OK mcbride@
Diffstat (limited to 'sys/netinet/ip_carp.c')
-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]));