summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2011-11-16 11:59:29 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2011-11-16 11:59:29 +0000
commitd3ac8cfdf8c457c11bb8541dbac8ae5662bb076d (patch)
treeae4c028b742c28c1802321ebde0d63c5fc4e5745
parent5d25708d90d1c775fd2c359440762a63ba8c4c4e (diff)
Improve flag setting ioctl so that bulk updates are requested
only when we're going up, not when we set PROMISC or any other flag. Fixes spontaneous CARP failovers when running tcpdump on pfsync. ok henning, mcbride, camield
-rw-r--r--sys/net/if_pfsync.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 1d0c4205137..660a60f68c9 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.173 2011/11/09 12:36:03 camield Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.174 2011/11/16 11:59:28 mikeb Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -1290,10 +1290,13 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
#endif
case SIOCSIFFLAGS:
s = splnet();
- if (ifp->if_flags & IFF_UP) {
+ if ((ifp->if_flags & IFF_RUNNING) == 0 &&
+ (ifp->if_flags & IFF_UP)) {
ifp->if_flags |= IFF_RUNNING;
pfsync_request_full_update(sc);
- } else {
+ }
+ if ((ifp->if_flags & IFF_RUNNING) &&
+ (ifp->if_flags & IFF_UP) == 0) {
ifp->if_flags &= ~IFF_RUNNING;
/* drop everything */