diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-04-09 22:27:55 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-04-09 22:27:55 +0000 |
commit | d703778564fdd20d7d87bcc126d0bc13d0391c58 (patch) | |
tree | 5cdc978ab23498e524dc0a2b714c54740e9c691d /sys/netinet/ip_ah.c | |
parent | c484101e1bc192709a5eda9420a1f3c50bc43cfd (diff) |
Make the tdbi handling more robust, removes a panic case
Diffstat (limited to 'sys/netinet/ip_ah.c')
-rw-r--r-- | sys/netinet/ip_ah.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c index 4fdb5d29813..5045c72c441 100644 --- a/sys/netinet/ip_ah.c +++ b/sys/netinet/ip_ah.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ah.c,v 1.19 1999/03/27 21:04:19 provos Exp $ */ +/* $OpenBSD: ip_ah.c,v 1.20 1999/04/09 22:27:54 niklas Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -248,9 +248,8 @@ ah_input(register struct mbuf *m, int iphlen) { DPRINTF(("ah_input(): mbuf is not a packet header!\n")); } - if (!tdbi || !(m->m_flags & (M_CONF|M_AUTH))) - MALLOC(tdbi, struct tdb_ident *, sizeof(struct tdb_ident), - M_TEMP, M_NOWAIT); + MALLOC(tdbi, struct tdb_ident *, sizeof(struct tdb_ident), + M_TEMP, M_NOWAIT); if (!tdbi) goto no_mem; @@ -260,9 +259,10 @@ ah_input(register struct mbuf *m, int iphlen) tdbi->proto = tdbp->tdb_bind_out->tdb_sproto; } - m->m_pkthdr.tdbi = tdbi; no_mem: - } + m->m_pkthdr.tdbi = tdbi; + } else + m->m_pkthdr.tdbi = NULL; /* Packet is authentic */ m->m_flags |= M_AUTH; |