From 8c74bad9f352ee33107ec1cbfa7273cb27d41a98 Mon Sep 17 00:00:00 2001 From: glebius Date: Tue, 20 Dec 2011 13:53:31 +0000 Subject: Restore a feature that was present in 5.x and 6.x, and was cleared in 7.x, 8.x and 9.x with pf(4) imports: pfsync(4) should suppress CARP preemption, while it is running its bulk update. However, reimplement the feature in more elegant manner, that is partially inspired by newer OpenBSD: - Rename term "suppression" to "demotion", to match with OpenBSD. - Keep a global demotion factor, that can be raised by several conditions, for now these are: - interface goes down - carp(4) has problems with ip_output() or ip6_output() - pfsync performs bulk update - Unlike in OpenBSD the demotion factor isn't a counter, but is actual value added to advskew. The adjustment values for particular error conditions are also configurable, and their defaults are maximum advskew value, so a single failure bumps demotion to maximum. This is for POLA compatibility, and should satisfy most users. - Demotion factor is a writable sysctl, so user can do foot shooting, if he desires to. --- sys/net/if.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/net') diff --git a/sys/net/if.c b/sys/net/if.c index 4377343..50aa11c 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -129,6 +129,7 @@ void (*ng_ether_link_state_p)(struct ifnet *ifp, int state); void (*lagg_linkstate_p)(struct ifnet *ifp, int state); /* These are external hooks for CARP. */ void (*carp_linkstate_p)(struct ifnet *ifp); +void (*carp_demote_adj_p)(int, char *); #if defined(INET) || defined(INET6) int (*carp_forus_p)(struct ifnet *ifp, u_char *dhost); int (*carp_output_p)(struct ifnet *ifp, struct mbuf *m, -- cgit v1.1