summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2010-06-29 21:28:37 +0000
committerreyk <reyk@openbsd.org>2010-06-29 21:28:37 +0000
commit8ddcae7338d81879e160a78411011d5b81dbde6e (patch)
treea55e7e9f71a6ac595bbe9b67475163d611591810 /sys/netinet/ip_output.c
parentDuring kernel bootstrap, stop assuming the kernel image has been loaded in (diff)
downloadwireguard-openbsd-8ddcae7338d81879e160a78411011d5b81dbde6e.tar.xz
wireguard-openbsd-8ddcae7338d81879e160a78411011d5b81dbde6e.zip
Replace enc(4) with a new implementation as a cloner device. We still
create enc0 by default, but it is possible to add additional enc interfaces. This will be used later to allow alternative encs per policy or to have an enc per rdomain when IPsec becomes rdomain-aware. manpage bits ok jmc@ input from henning@ deraadt@ toby@ naddy@ ok henning@ claudio@
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 40011b9a522..6081689e069 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.205 2010/05/07 13:33:17 claudio Exp $ */
+/* $OpenBSD: ip_output.c,v 1.206 2010/06/29 21:28:38 reyk Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -121,6 +121,9 @@ ip_output(struct mbuf *m0, ...)
struct inpcb *inp;
struct tdb *tdb;
int s;
+#if NPF > 0
+ struct ifnet *encif;
+#endif
#endif /* IPSEC */
va_start(ap, m0);
@@ -587,8 +590,8 @@ sendit:
* Packet filter
*/
#if NPF > 0
-
- if (pf_test(PF_OUT, &encif[0].sc_if, &m, NULL) != PF_PASS) {
+ if ((encif = enc_getif(0)) == NULL ||
+ pf_test(PF_OUT, encif, &m, NULL) != PF_PASS) {
error = EHOSTUNREACH;
splx(s);
m_freem(m);