Module Name: src
Committed By: msaitoh
Date: Tue Aug 20 03:56:59 UTC 2019
Modified Files:
src/sys/net: if_vlan.c
Log Message:
Add missing IFNET_LOCK() and IFNET_UNLOCK() in vlan_config().
XXX pullup-9
To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/sys/net/if_vlan.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.142 src/sys/net/if_vlan.c:1.143
--- src/sys/net/if_vlan.c:1.142 Tue Aug 20 03:50:55 2019
+++ src/sys/net/if_vlan.c Tue Aug 20 03:56:59 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vlan.c,v 1.142 2019/08/20 03:50:55 msaitoh Exp $ */
+/* $NetBSD: if_vlan.c,v 1.143 2019/08/20 03:56:59 msaitoh 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.142 2019/08/20 03:50:55 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.143 2019/08/20 03:56:59 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -494,8 +494,11 @@ vlan_config(struct ifvlan *ifv, struct i
KM_SLEEP);
if (vidmem == NULL){
ec->ec_nvlans--;
- if (ec->ec_nvlans == 0)
+ if (ec->ec_nvlans == 0) {
+ IFNET_LOCK(p);
(void)ether_disable_vlan_mtu(p);
+ IFNET_UNLOCK(p);
+ }
error = ENOMEM;
goto done;
}
@@ -509,8 +512,11 @@ vlan_config(struct ifvlan *ifv, struct i
error = (*ec->ec_vlan_cb)(ec, vid, true);
if (error) {
ec->ec_nvlans--;
- if (ec->ec_nvlans == 0)
+ if (ec->ec_nvlans == 0) {
+ IFNET_LOCK(p);
(void)ether_disable_vlan_mtu(p);
+ IFNET_UNLOCK(p);
+ }
goto done;
}
}