diff options
author | Marco Pfatschbacher <mpf@cvs.openbsd.org> | 2006-06-02 19:53:13 +0000 |
---|---|---|
committer | Marco Pfatschbacher <mpf@cvs.openbsd.org> | 2006-06-02 19:53:13 +0000 |
commit | bcd3f8f0d9fbf81babcd87d65fd75f73642581a2 (patch) | |
tree | 3fd29f560705ee795bfede421840439d62026d09 /sys/net/if.h | |
parent | 6de597ae247e471ba7a7fee9b537d54455271290 (diff) |
Introduce attributes to interface groups.
As a first user, move the global carp(4) demotion counter
into the interface group. Thus we have the possibility
to define which carp interfaces are demoted together.
Put the demotion counter into the reserved field of the carp header.
With this, we can have carp act smarter if multiple errors occur.
It now always takes over other carp peers, that are advertising
with a higher demote count. As a side effect, we can also have
group failovers without the need of running in preempt mode.
The protocol change does not break compability with older
implementations.
Collaborative work with mcbride@
OK mcbride@, henning@
Diffstat (limited to 'sys/net/if.h')
-rw-r--r-- | sys/net/if.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/net/if.h b/sys/net/if.h index cef94421001..2e54ccd76ad 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if.h,v 1.81 2006/05/27 10:03:15 brad Exp $ */ +/* $OpenBSD: if.h,v 1.82 2006/06/02 19:53:12 mpf Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -433,6 +433,7 @@ struct ifg_group { char ifg_group[IFNAMSIZ]; u_int ifg_refcnt; caddr_t ifg_pf_kif; + int ifg_carp_demoted; TAILQ_HEAD(, ifg_member) ifg_members; TAILQ_ENTRY(ifg_group) ifg_next; }; @@ -456,6 +457,10 @@ struct ifg_req { #define ifgrq_member ifgrq_ifgrqu.ifgrqu_member }; +struct ifg_attrib { + int ifg_carp_demoted; +}; + /* * Used to lookup groups for an interface */ @@ -463,11 +468,13 @@ struct ifgroupreq { char ifgr_name[IFNAMSIZ]; u_int ifgr_len; union { - char ifgru_group[IFNAMSIZ]; - struct ifg_req *ifgru_groups; + char ifgru_group[IFNAMSIZ]; + struct ifg_req *ifgru_groups; + struct ifg_attrib ifgru_attrib; } ifgr_ifgru; #define ifgr_group ifgr_ifgru.ifgru_group #define ifgr_groups ifgr_ifgru.ifgru_groups +#define ifgr_attrib ifgr_ifgru.ifgru_attrib }; /* |