summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2014-10-07 08:59:50 +0000
committermpi <mpi@openbsd.org>2014-10-07 08:59:50 +0000
commit89a3edd16f6b1725d0acc4856f980632bc6e1eb8 (patch)
treeb2b36699b6a7a55e035193bf28a7a7ad3502b5b1
parentDo not protect the SIOCSIFADDR call by splnet(). Drivers already (diff)
downloadwireguard-openbsd-89a3edd16f6b1725d0acc4856f980632bc6e1eb8.tar.xz
wireguard-openbsd-89a3edd16f6b1725d0acc4856f980632bc6e1eb8.zip
Since the list of mpe(4) interfaces is only accessed in process context,
it does not need to be protected by splnet(). Rafael Zalamena agrees, no objection from the MPLS gang.
-rw-r--r--sys/net/if_mpe.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c
index 74039dcda59..d601111c899 100644
--- a/sys/net/if_mpe.c
+++ b/sys/net/if_mpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mpe.c,v 1.35 2014/07/22 11:06:09 mpi Exp $ */
+/* $OpenBSD: if_mpe.c,v 1.36 2014/10/07 08:59:50 mpi Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -84,7 +84,6 @@ mpe_clone_create(struct if_clone *ifc, int unit)
{
struct ifnet *ifp;
struct mpe_softc *mpeif;
- int s;
if ((mpeif = malloc(sizeof(*mpeif),
M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL)
@@ -110,9 +109,7 @@ mpe_clone_create(struct if_clone *ifc, int unit)
bpfattach(&ifp->if_bpf, ifp, DLT_LOOP, sizeof(u_int32_t));
#endif
- s = splnet();
LIST_INSERT_HEAD(&mpeif_list, mpeif, sc_list);
- splx(s);
return (0);
}
@@ -121,11 +118,8 @@ int
mpe_clone_destroy(struct ifnet *ifp)
{
struct mpe_softc *mpeif = ifp->if_softc;
- int s;
- s = splnet();
LIST_REMOVE(mpeif, sc_list);
- splx(s);
if_detach(ifp);
free(mpeif, M_DEVBUF, 0);