summaryrefslogtreecommitdiff
path: root/sys/netinet6/ip6_output.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-06-27 01:36:03 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-06-27 01:36:03 +0000
commit10be5462b8b0fce3329a0640d773ac9d35609426 (patch)
tree76e3ae48fc9802b11910a904d62dd3697841eccd /sys/netinet6/ip6_output.c
parentb6a7a7ace82099c72493dcb71528b94a8cfcc618 (diff)
Don't check cached TDBs on the PCB -- always call ipsp_spd_lookup();
this simplifies the logic a bit.
Diffstat (limited to 'sys/netinet6/ip6_output.c')
-rw-r--r--sys/netinet6/ip6_output.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 068573d8ead..1ad8295e6aa 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_output.c,v 1.44 2001/06/25 17:16:27 angelos Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.45 2001/06/27 01:36:02 angelos Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -207,32 +207,24 @@ ip6_output(m0, opt, ro, flags, im6o, ifpp)
* from a transport protocol.
*/
ip6 = mtod(m, struct ip6_hdr *);
- if (inp && inp->inp_tdb_out &&
- inp->inp_tdb_out->tdb_dst.sa.sa_family == AF_INET6 &&
- IN6_ARE_ADDR_EQUAL(&inp->inp_tdb_out->tdb_dst.sin6.sin6_addr,
- &ip6->ip6_dst)) {
- tdb = inp->inp_tdb_out;
- } else {
- /* Do we have any pending SAs to apply ? */
- mtag = m_tag_find(m, PACKET_TAG_IPSEC_PENDING_TDB, NULL);
- if (mtag != NULL) {
+
+ /* Do we have any pending SAs to apply ? */
+ mtag = m_tag_find(m, PACKET_TAG_IPSEC_PENDING_TDB, NULL);
+ if (mtag != NULL) {
#ifdef DIAGNOSTIC
- if (mtag->m_tag_len != sizeof (struct tdb_ident))
- panic("ip6_output: tag of length %d (should "
- "be %d", mtag->m_tag_len,
- sizeof (struct tdb_ident));
+ if (mtag->m_tag_len != sizeof (struct tdb_ident))
+ panic("ip6_output: tag of length %d (should be %d",
+ mtag->m_tag_len, sizeof (struct tdb_ident));
#endif
- tdbi = (struct tdb_ident *)(mtag + 1);
- tdb = gettdb(tdbi->spi, &tdbi->dst, tdbi->proto);
- if (tdb == NULL)
- error = -EINVAL;
- m_tag_delete(m, mtag);
- }
- else
- tdb = ipsp_spd_lookup(m, AF_INET6,
- sizeof(struct ip6_hdr), &error,
- IPSP_DIRECTION_OUT, NULL, inp);
+ tdbi = (struct tdb_ident *)(mtag + 1);
+ tdb = gettdb(tdbi->spi, &tdbi->dst, tdbi->proto);
+ if (tdb == NULL)
+ error = -EINVAL;
+ m_tag_delete(m, mtag);
}
+ else
+ tdb = ipsp_spd_lookup(m, AF_INET6, sizeof(struct ip6_hdr),
+ &error, IPSP_DIRECTION_OUT, NULL, inp);
if (tdb == NULL) {
splx(s);