summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2012-06-30 00:14:24 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2012-06-30 00:14:24 +0000
commite17e4937d7a4e95d5c9bfc1ac8f907584af441eb (patch)
tree69d43cf4e6a512b5e45d18fdba3cbd4d00a7e460 /sys
parentef97337b760b96a9348450476203e259ac026705 (diff)
backout rev1.185 as it's not what i have intended to commit
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_pfsync.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 1de226decfd..ab38996ca11 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.186 2012/06/29 15:12:21 mikeb Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.187 2012/06/30 00:14:23 mikeb Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -212,8 +212,6 @@ struct pfsync_softc {
struct pfsync_upd_reqs sc_upd_req_list;
- int sc_link_demote;
-
int sc_defer;
struct pfsync_deferrals sc_deferrals;
u_int sc_deferred;
@@ -421,13 +419,11 @@ pfsync_syncdev_state(void *arg)
if (!sc->sc_sync_if)
return;
- if (sc->sc_sync_if->if_link_state == LINK_STATE_DOWN) {
+ if (sc->sc_sync_if->if_link_state == LINK_STATE_DOWN ||
+ !(sc->sc_sync_if->if_flags & IFF_UP)) {
sc->sc_if.if_flags &= ~IFF_RUNNING;
#if NCARP > 0
- if (!sc->sc_link_demote) {
- carp_group_demote_adj(&sc->sc_if, 1, "pfsyncdev");
- sc->sc_link_demote = 1;
- }
+ carp_group_demote_adj(&sc->sc_if, 1, "pfsyncdev");
#endif
/* drop everything */
timeout_del(&sc->sc_tmo);
@@ -439,8 +435,10 @@ pfsync_syncdev_state(void *arg)
sc->sc_bulk_last = NULL;
} else {
sc->sc_if.if_flags |= IFF_RUNNING;
-
pfsync_request_full_update(sc);
+#if NCARP > 0
+ carp_group_demote_adj(&sc->sc_if, -1, "pfsyncdev");
+#endif
}
}
@@ -1154,11 +1152,6 @@ pfsync_in_bus(caddr_t buf, int len, int count, int flags)
if (!pfsync_sync_ok)
carp_group_demote_adj(&sc->sc_if, -1,
"pfsync bulk done");
- if (sc->sc_link_demote) {
- carp_group_demote_adj(&sc->sc_if, -1,
- "pfsyncdev");
- sc->sc_link_demote = 0;
- }
#endif
pfsync_sync_ok = 1;
DPFPRINTF(LOG_INFO, "received valid bulk update end");
@@ -2284,10 +2277,6 @@ pfsync_bulk_fail(void *arg)
if (!pfsync_sync_ok)
carp_group_demote_adj(&sc->sc_if, -1,
"pfsync bulk fail");
- if (sc->sc_link_demote) {
- carp_group_demote_adj(&sc->sc_if, -1, "pfsyncdev");
- sc->sc_link_demote = 0;
- }
#endif
pfsync_sync_ok = 1;
DPFPRINTF(LOG_ERR, "failed to receive bulk update");