summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2003-10-20 03:01:02 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2003-10-20 03:01:02 +0000
commit109c6331924a04d51116ec98ef070f56af99022a (patch)
tree32710ba1b25deeb0059a3ee6074f0c3fc308c640
parent15c4b8e64e1e9665535bac1f297268cfd59bb923 (diff)
Stop all hosts from insisting they're master when preemption is
disabled. bug report and fix testing david@
-rw-r--r--sys/netinet/ip_carp.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 5252c1b3e4c..bb2ac380e4e 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.3 2003/10/20 00:43:58 mcbride Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.4 2003/10/20 03:01:01 mcbride Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -352,14 +352,12 @@ carp_input(struct mbuf *m, ...)
break;
case MASTER:
/*
- * If we're allowing preemption, and we recieve an advertisement
- * from a master who's going to be more frequent than us,
- * go into BACKUP state.
+ * If we recieve an advertisement from a master who's going to
+ * be more frequent than us, go into BACKUP state.
*/
- if (carp_opts[CARPCTL_PREEMPT] &&
- (timercmp(&sc_tv, &ch_tv, >) ||
+ if (timercmp(&sc_tv, &ch_tv, >) ||
(timercmp(&sc_tv, &ch_tv, ==) &&
- ip->ip_src.s_addr > sc->sc_ia->ia_addr.sin_addr.s_addr))) {
+ ip->ip_src.s_addr > sc->sc_ia->ia_addr.sin_addr.s_addr)) {
timeout_del(&sc->sc_ad_tmo);
sc->sc_state = BACKUP;
carp_setrun(sc);
@@ -733,7 +731,7 @@ carp_setrun(struct carp_softc *sc)
switch (sc->sc_state) {
case INIT:
- if (sc->sc_advskew == 0) {
+ if (carp_opts[CARPCTL_PREEMPT]) {
carp_send_ad(sc);
carp_send_arp(sc);
sc->sc_state = MASTER;