summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-01-10 02:45:13 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-01-10 02:45:13 +0000
commit6c925620850fb2232aacf6501ddb6543f5494a94 (patch)
treed1c053d18a6b902c946385565c98e9a91fae3003
parent61623e91f29c23533927cd67259f2711d7ad0c0e (diff)
Fix tdbi setup for TCP and UDP packets.
-rw-r--r--sys/netinet/ipsec_input.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c
index 95a26653052..ec86700f477 100644
--- a/sys/netinet/ipsec_input.c
+++ b/sys/netinet/ipsec_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_input.c,v 1.11 2000/01/10 01:23:27 angelos Exp $ */
+/* $OpenBSD: ipsec_input.c,v 1.12 2000/01/10 02:45:12 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -523,26 +523,26 @@ ipsec_common_input(struct mbuf **m0, int skip, int protoff, int af, int sproto)
if (prot == IPPROTO_TCP || prot == IPPROTO_UDP)
{
- struct tdb_ident *tdbi = NULL;
-
if (tdbp->tdb_bind_out)
{
- tdbi = m->m_pkthdr.tdbi;
if (!(m->m_flags & M_PKTHDR))
DPRINTF(("%s: mbuf is not a packet header!\n", IPSEC_NAME));
- MALLOC(tdbi, struct tdb_ident *, sizeof(struct tdb_ident),
- M_TEMP, M_NOWAIT);
+ MALLOC(m->m_pkthdr.tdbi, struct tdb_ident *,
+ sizeof(struct tdb_ident), M_TEMP, M_NOWAIT);
- if (tdbi == NULL)
- m->m_pkthdr.tdbi = NULL;
- else
+ if (m->m_pkthdr.tdbi == NULL)
{
- tdbi->spi = tdbp->tdb_bind_out->tdb_spi;
- tdbi->dst = tdbp->tdb_bind_out->tdb_dst;
- tdbi->proto = tdbp->tdb_bind_out->tdb_sproto;
+ ((struct tdb_ident *) m->m_pkthdr.tdbi)->spi =
+ tdbp->tdb_bind_out->tdb_spi;
+ ((struct tdb_ident *) m->m_pkthdr.tdbi)->dst =
+ tdbp->tdb_bind_out->tdb_dst;
+ ((struct tdb_ident *) m->m_pkthdr.tdbi)->proto =
+ tdbp->tdb_bind_out->tdb_sproto;
}
}
+ else
+ m->m_pkthdr.tdbi = NULL;
}
else
m->m_pkthdr.tdbi = NULL;