summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2020-06-21 12:11:26 +0000
committerdlg <dlg@openbsd.org>2020-06-21 12:11:26 +0000
commit58360b13e88a8f23faf2a04ee8f459832fd7e8d8 (patch)
treecbdc0608dc07ff800586401895afccdfff2a2f43 /sys/net/if.c
parentwireguard is taking over the gif mbuf tag. (diff)
downloadwireguard-openbsd-58360b13e88a8f23faf2a04ee8f459832fd7e8d8.tar.xz
wireguard-openbsd-58360b13e88a8f23faf2a04ee8f459832fd7e8d8.zip
add wg(4), an in kernel driver for WireGuard vpn communication.
thanks to Matt Dunwoodie and Jason A. Donenfeld for their effort. it's at least as functional as the go implementation, and maybe more so since this one works on more architectures. i'm sure there's further development that can be done, but you can say that about anything and everything that's in the tree. ok deraadt@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 1cd42e48bc5..8ba5cda6494 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.607 2020/06/17 06:45:22 dlg Exp $ */
+/* $OpenBSD: if.c,v 1.608 2020/06/21 12:11:26 dlg Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -70,6 +70,7 @@
#include "ppp.h"
#include "pppoe.h"
#include "switch.h"
+#include "if_wg.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -2228,6 +2229,13 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
/* don't take NET_LOCK because i2c reads take a long time */
error = ((*ifp->if_ioctl)(ifp, cmd, data));
break;
+ case SIOCSWG:
+ case SIOCGWG:
+ /* Don't take NET_LOCK to allow wg(4) to continue to send and
+ * receive packets while we're loading a large number of
+ * peers. wg(4) uses its own lock to serialise access. */
+ error = ((*ifp->if_ioctl)(ifp, cmd, data));
+ break;
case SIOCSETKALIVE:
case SIOCDIFPHYADDR: