Wed Jul 14 06:50:22 2021 UTC ()
unset IFF_PROMISC at bpf_detach()

Doing "d->bd_promisc = 0" is that bpf_detach() does not call
ifpromisc(ifp, 0). Currently, there is no reason for
this behavior so that it is removed.
In addition to the change, the workaround for it in vlan(4)
is also removed.


(yamaguchi)
diff -r1.240 -r1.241 src/sys/net/bpf.c
diff -r1.158 -r1.159 src/sys/net/if_vlan.c

cvs diff -r1.240 -r1.241 src/sys/net/bpf.c (expand / switch to context diff)
--- src/sys/net/bpf.c 2021/06/09 15:44:15 1.240
+++ src/sys/net/bpf.c 2021/07/14 06:50:22 1.241
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.240 2021/06/09 15:44:15 martin Exp $	*/
+/*	$NetBSD: bpf.c,v 1.241 2021/07/14 06:50:22 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.240 2021/06/09 15:44:15 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.241 2021/07/14 06:50:22 yamaguchi Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -2194,7 +2194,6 @@
 			 * Detach the descriptor from an interface now.
 			 * It will be free'ed later by close routine.
 			 */
-			d->bd_promisc = 0;	/* we can't touch device. */
 			bpf_detachd(d);
 			mutex_exit(d->bd_mtx);
 			goto again_d;

cvs diff -r1.158 -r1.159 src/sys/net/if_vlan.c (expand / switch to context diff)
--- src/sys/net/if_vlan.c 2021/07/14 06:23:06 1.158
+++ src/sys/net/if_vlan.c 2021/07/14 06:50:22 1.159
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.158 2021/07/14 06:23:06 yamaguchi Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.159 2021/07/14 06:50:22 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.158 2021/07/14 06:23:06 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.159 2021/07/14 06:50:22 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -701,8 +701,6 @@
 	KERNEL_UNLOCK_UNLESS_NET_MPSAFE();
 #endif
 
-	if ((ifp->if_flags & IFF_PROMISC) != 0)
-		vlan_safe_ifpromisc_locked(ifp, 0);
 	if_down_locked(ifp);
 	ifp->if_capabilities = 0;
 	mutex_enter(&ifv->ifv_lock);