summaryrefslogtreecommitdiff
path: root/sys/net/switchctl.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-12-12 09:51:31 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-12-12 09:51:31 +0000
commit6b24d521ba3db74ba27aeb9526343a42a0af2440 (patch)
treef0c2751e23cd22d39f8aac40cb7ff49dd1488532 /sys/net/switchctl.c
parentc6c393e63a21d9712941f8321c00b92513f265bf (diff)
Remove most of the splsoftnet() recursions related to cloned interfaces.
inputs and ok bluhm@
Diffstat (limited to 'sys/net/switchctl.c')
-rw-r--r--sys/net/switchctl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net/switchctl.c b/sys/net/switchctl.c
index 49edf759af3..a09658d8938 100644
--- a/sys/net/switchctl.c
+++ b/sys/net/switchctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: switchctl.c,v 1.8 2016/11/11 16:19:09 rzalamena Exp $ */
+/* $OpenBSD: switchctl.c,v 1.9 2016/12/12 09:51:30 mpi Exp $ */
/*
* Copyright (c) 2016 Kazuya GODA <goda@openbsd.org>
@@ -84,11 +84,14 @@ switchopen(dev_t dev, int flags, int mode, struct proc *p)
struct switch_softc *sc;
char name[IFNAMSIZ];
int rv, s, error = 0;
+ unsigned int rdomain = rtable_l2(p->p_p->ps_rtableid);
if ((sc = switch_dev2sc(dev)) == NULL) {
snprintf(name, sizeof(name), "switch%d", minor(dev));
- if ((rv = if_clone_create(name,
- rtable_l2(p->p_p->ps_rtableid))) != 0)
+ s = splsoftnet();
+ rv = if_clone_create(name, rdomain);
+ splx(s);
+ if (rv != 0)
return (rv);
if ((sc = switch_dev2sc(dev)) == NULL)
return (ENXIO);