aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ip_carp.h
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2011-12-20 13:53:31 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2011-12-20 13:53:31 +0000
commitf08535f8727db100757115023ae19d0bc1eac194 (patch)
tree5763c925081c47070f96599b2dbbbeee072455c2 /sys/netinet/ip_carp.h
parent73889c808a4d1867f75a87d7e8d78e66120356e8 (diff)
downloadsrc-f08535f8727db100757115023ae19d0bc1eac194.tar.gz
src-f08535f8727db100757115023ae19d0bc1eac194.zip
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.
Notes
Notes: svn path=/head/; revision=228736
Diffstat (limited to 'sys/netinet/ip_carp.h')
-rw-r--r--sys/netinet/ip_carp.h19
1 files changed, 2 insertions, 17 deletions
diff --git a/sys/netinet/ip_carp.h b/sys/netinet/ip_carp.h
index d8b82a8d00fc..7be91c015e6e 100644
--- a/sys/netinet/ip_carp.h
+++ b/sys/netinet/ip_carp.h
@@ -133,29 +133,13 @@ struct carpreq {
#define CARP_STATES "INIT", "BACKUP", "MASTER"
#define CARP_MAXSTATE 2
int carpr_advskew;
+#define CARP_MAXSKEW 240
int carpr_advbase;
unsigned char carpr_key[CARP_KEY_LEN];
};
#define SIOCSVH _IOWR('i', 245, struct ifreq)
#define SIOCGVH _IOWR('i', 246, struct ifreq)
-/*
- * Names for CARP sysctl objects
- */
-#define CARPCTL_ALLOW 1 /* accept incoming CARP packets */
-#define CARPCTL_PREEMPT 2 /* high-pri backup preemption mode */
-#define CARPCTL_LOG 3 /* log bad packets */
-#define CARPCTL_STATS 4 /* statistics (read-only) */
-#define CARPCTL_MAXID 5
-
-#define CARPCTL_NAMES { \
- { 0, 0 }, \
- { "allow", CTLTYPE_INT }, \
- { "preempt", CTLTYPE_INT }, \
- { "log", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
-}
-
#ifdef _KERNEL
int carp_ioctl(struct ifreq *, u_long, struct thread *);
int carp_attach(struct ifaddr *, int);
@@ -175,6 +159,7 @@ extern int (*carp_ioctl_p)(struct ifreq *, u_long, struct thread *);
extern int (*carp_attach_p)(struct ifaddr *, int);
extern void (*carp_detach_p)(struct ifaddr *);
extern void (*carp_linkstate_p)(struct ifnet *);
+extern void (*carp_demote_adj_p)(int, char *);
/* net/if_bridge.c net/if_ethersubr.c */
extern int (*carp_forus_p)(struct ifnet *, u_char *);
/* net/if_ethersubr.c */