summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ah.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-10-29 05:21:46 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-10-29 05:21:46 +0000
commit1e8f0d5741ba62b4b7aaabea82c95e61190397db (patch)
treea1594b59048ea8b9442c91ac1240729446ab175b /sys/netinet/ip_ah.c
parent49d86ef377278b4b37af65682b9eaff8b4862065 (diff)
Support multiple enc interfaces.
Diffstat (limited to 'sys/netinet/ip_ah.c')
-rw-r--r--sys/netinet/ip_ah.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c
index b8ccf123112..460d6de91c2 100644
--- a/sys/netinet/ip_ah.c
+++ b/sys/netinet/ip_ah.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ah.c,v 1.24 1999/07/05 20:17:06 deraadt Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.25 1999/10/29 05:21:45 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -57,7 +57,6 @@
#include <net/route.h>
#include <net/netisr.h>
#include <net/bpf.h>
-#include <net/if_enc.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
@@ -73,9 +72,11 @@
#include <netinet/ip_ipsp.h>
#include <netinet/ip_ah.h>
+#include <net/if_enc.h>
+
#include "bpfilter.h"
-extern struct ifnet encif;
+extern struct enc_softc encif[];
#ifdef ENCDEBUG
#define DPRINTF(x) if (encdebug) printf x
@@ -173,7 +174,10 @@ ah_input(m, va_alist)
return;
}
- m->m_pkthdr.rcvif = &encif;
+ if (tdbp->tdb_interface)
+ m->m_pkthdr.rcvif = (struct ifnet *) tdbp->tdb_interface;
+ else
+ m->m_pkthdr.rcvif = &encif[0].sc_if;
/* Register first use, setup expiration timer */
if (tdbp->tdb_first_use == 0)
@@ -269,7 +273,7 @@ ah_input(m, va_alist)
m->m_flags |= M_AUTH;
#if NBPFILTER > 0
- if (encif.if_bpf)
+ if (m->m_pkthdr.rcvif->if_bpf)
{
/*
* We need to prepend the address family as
@@ -289,7 +293,7 @@ ah_input(m, va_alist)
m0.m_len = ENC_HDRLEN;
m0.m_data = (char *) &hdr;
- bpf_mtap(encif.if_bpf, &m0);
+ bpf_mtap(m->m_pkthdr.rcvif->if_bpf, &m0);
}
#endif