diff options
author | Joel Knight <joel@cvs.openbsd.org> | 2007-09-03 06:10:55 +0000 |
---|---|---|
committer | Joel Knight <joel@cvs.openbsd.org> | 2007-09-03 06:10:55 +0000 |
commit | 2b17758a78200037a7a799da39915fd208321174 (patch) | |
tree | 2e46ba8ac8bc302c3d0e2df653eee7c31508f052 | |
parent | 8a9da53e94decc986720f2a9bd7e6953d6cc8a49 (diff) |
Make use of the carp preempt counter to signal number of transitions of
any carp group to master status.
ok dhartmei@
-rw-r--r-- | sys/netinet/ip_carp.c | 3 | ||||
-rw-r--r-- | sys/netinet/ip_carp.h | 4 | ||||
-rw-r--r-- | usr.bin/netstat/inet.c | 5 |
3 files changed, 7 insertions, 5 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index d7d1cbd798c..ab2e8a5793d 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.147 2007/06/23 16:15:26 reyk Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.148 2007/09/03 06:10:54 joel Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -1598,6 +1598,7 @@ carp_master_down(void *v) #endif /* INET6 */ carp_setrun(sc, 0); carp_setroute(sc, RTM_ADD); + carpstats.carps_preempt++; break; } } diff --git a/sys/netinet/ip_carp.h b/sys/netinet/ip_carp.h index 874b96abed9..94c1f15bb3a 100644 --- a/sys/netinet/ip_carp.h +++ b/sys/netinet/ip_carp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.h,v 1.22 2007/03/18 23:23:17 mpf Exp $ */ +/* $OpenBSD: ip_carp.h,v 1.23 2007/09/03 06:10:54 joel Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -109,7 +109,7 @@ struct carpstats { u_int64_t carps_onomem; /* no memory for an mbuf */ u_int64_t carps_ostates; /* total state updates sent */ - u_int64_t carps_preempt; /* if enabled, preemptions */ + u_int64_t carps_preempt; /* transitions to master */ }; #define CARPDEVNAMSIZ 16 diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index d22ee08ce9a..2ef4ac59c02 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet.c,v 1.100 2007/06/19 05:28:30 ray Exp $ */ +/* $OpenBSD: inet.c,v 1.101 2007/09/03 06:10:54 joel Exp $ */ /* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94"; #else -static const char *rcsid = "$OpenBSD: inet.c,v 1.100 2007/06/19 05:28:30 ray Exp $"; +static const char *rcsid = "$OpenBSD: inet.c,v 1.101 2007/09/03 06:10:54 joel Exp $"; #endif #endif /* not lint */ @@ -950,6 +950,7 @@ carp_stats(u_long off, char *name) p(carps_opackets, "\t%llu packet%s sent (IPv4)\n"); p(carps_opackets6, "\t%llu packet%s sent (IPv6)\n"); p2(carps_onomem, "\t\t%llu send failed due to mbuf memory error\n"); + p(carps_preempt, "\t%llu transition%s to master\n"); #undef p #undef p2 } |