diff options
author | 2017-08-12 20:27:28 +0000 | |
---|---|---|
committer | 2017-08-12 20:27:28 +0000 | |
commit | 5fc952f56a00df639f36bb931d25d61aa45ee1f5 (patch) | |
tree | a7650f98fed17dd8a371371038e7e3b5e2cfa2b8 /sys/net/if.c | |
parent | Use ctfstrip(1) by default to strip kernels. (diff) | |
download | wireguard-openbsd-5fc952f56a00df639f36bb931d25d61aa45ee1f5.tar.xz wireguard-openbsd-5fc952f56a00df639f36bb931d25d61aa45ee1f5.zip |
Use the NET_LOCK() macro instead of handrolling it.
Tested by Hrvoje Popovski.
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 0f75f4e229a..b4b419dd845 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.510 2017/08/11 21:24:19 mpi Exp $ */ +/* $OpenBSD: if.c,v 1.511 2017/08/12 20:27:28 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1176,9 +1176,9 @@ if_clone_create(const char *name, int rdomain) return (EEXIST); /* XXXSMP breaks atomicity */ - rw_exit_write(&netlock); + NET_UNLOCK(); ret = (*ifc->ifc_create)(ifc, unit); - rw_enter_write(&netlock); + NET_LOCK(); if (ret != 0 || (ifp = ifunit(name)) == NULL) return (ret); @@ -1221,9 +1221,9 @@ if_clone_destroy(const char *name) } /* XXXSMP breaks atomicity */ - rw_exit_write(&netlock); + NET_UNLOCK(); ret = (*ifc->ifc_destroy)(ifp); - rw_enter_write(&netlock); + NET_LOCK(); return (ret); } |