summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_carp.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2005-05-15 01:44:26 +0000
committerglebius <glebius@FreeBSD.org>2005-05-15 01:44:26 +0000
commited7b2b99371ad0e5c33da80646dd3e0af64d6a13 (patch)
tree39d13c95e29445d7b5ada92ab5d41d2e56c54e47 /sys/netinet/ip_carp.c
parentaf76c232de492b1de22ebf47a7d3cbeaf64e3715 (diff)
downloadFreeBSD-src-ed7b2b99371ad0e5c33da80646dd3e0af64d6a13.zip
FreeBSD-src-ed7b2b99371ad0e5c33da80646dd3e0af64d6a13.tar.gz
- When carp interface is destroyed, and it affects global preemption
suppresion counter, decrease the latter. [1] - Add sysctl to monitor preemption suppression. PR: kern/80972 [1] Submitted by: Frank Volf [1] MFC after: 1 week
Diffstat (limited to 'sys/netinet/ip_carp.c')
-rw-r--r--sys/netinet/ip_carp.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 13ea820..f84b9bd 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -140,6 +140,8 @@ SYSCTL_INT(_net_inet_carp, CARPCTL_LOG, log, CTLFLAG_RW,
&carp_opts[CARPCTL_LOG], 0, "log bad carp packets");
SYSCTL_INT(_net_inet_carp, CARPCTL_ARPBALANCE, arpbalance, CTLFLAG_RW,
&carp_opts[CARPCTL_ARPBALANCE], 0, "balance arp responses");
+SYSCTL_INT(_net_inet_carp, OID_AUTO, suppress_preempt, CTLFLAG_RD,
+ &carp_suppress_preempt, 0, "Preemption is suppressed");
struct carpstats carpstats;
SYSCTL_STRUCT(_net_inet_carp, CARPCTL_STATS, stats, CTLFLAG_RW,
@@ -400,7 +402,16 @@ carp_clone_destroy(struct ifnet *ifp)
#endif
/* carpdetach(sc); */
-
+
+ /*
+ * If an interface is destroyed which is suppressing the preemption,
+ * decrease the global counter, otherwise the host will never get
+ * out of the carp supressing state.
+ */
+ if (sc->sc_suppress)
+ carp_suppress_preempt--;
+ sc->sc_suppress = 0;
+
callout_stop(&sc->sc_ad_tmo);
callout_stop(&sc->sc_md_tmo);
callout_stop(&sc->sc_md6_tmo);
OpenPOWER on IntegriCloud