summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2011-11-16 11:59:28 +0000
committermikeb <mikeb@openbsd.org>2011-11-16 11:59:28 +0000
commitccdf19f34912ba5ba7e1164e4842e32c4e8f5dde (patch)
treec4aee5bb4eaf9aa48de99ca270382a399bfeeb83 /sys
parentif the portstree gives us a cache directory, use it. (diff)
downloadwireguard-openbsd-ccdf19f34912ba5ba7e1164e4842e32c4e8f5dde.tar.xz
wireguard-openbsd-ccdf19f34912ba5ba7e1164e4842e32c4e8f5dde.zip
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
Diffstat (limited to 'sys')
-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 */