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 | |
parent | c484101e1bc192709a5eda9420a1f3c50bc43cfd (diff) |
Make the tdbi handling more robust, removes a panic case
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_ah.c | 12 | ||||
-rw-r--r-- | sys/netinet/ip_esp.c | 12 |
2 files changed, 12 insertions, 12 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; diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index b099bdd1579..b99460802e1 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.19 1999/03/27 21:04:19 provos Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.20 1999/04/09 22:27:53 niklas Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -247,9 +247,8 @@ esp_input(register struct mbuf *m, int iphlen) { DPRINTF(("esp_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; @@ -259,9 +258,10 @@ esp_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 confidental */ m->m_flags |= M_CONF; |