diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2016-12-22 15:06:48 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2016-12-22 15:06:48 +0000 |
commit | 23abe11004bd22139f5e8561fcfbbea7cb31885c (patch) | |
tree | 47c9cd2c124edde56f28077ff343fb3578ce2dd4 /sys/net/switchctl.c | |
parent | 6f9254ad976de403091ff5ff74b62750b81bb70e (diff) |
Grab the netlock when device is opened; ok mpi, rzalamena
Diffstat (limited to 'sys/net/switchctl.c')
-rw-r--r-- | sys/net/switchctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/switchctl.c b/sys/net/switchctl.c index a09658d8938..b8d308ada29 100644 --- a/sys/net/switchctl.c +++ b/sys/net/switchctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: switchctl.c,v 1.9 2016/12/12 09:51:30 mpi Exp $ */ +/* $OpenBSD: switchctl.c,v 1.10 2016/12/22 15:06:47 mikeb Exp $ */ /* * Copyright (c) 2016 Kazuya GODA <goda@openbsd.org> @@ -88,9 +88,9 @@ switchopen(dev_t dev, int flags, int mode, struct proc *p) if ((sc = switch_dev2sc(dev)) == NULL) { snprintf(name, sizeof(name), "switch%d", minor(dev)); - s = splsoftnet(); + NET_LOCK(s); rv = if_clone_create(name, rdomain); - splx(s); + NET_UNLOCK(s); if (rv != 0) return (rv); if ((sc = switch_dev2sc(dev)) == NULL) |