diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2002-06-19 22:03:47 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2002-06-19 22:03:47 +0000 |
commit | 369dac595f557a7860e1fba5afd10ec3fc8002e8 (patch) | |
tree | 90cd11211ad317cb4ce79e92026603a0f1189217 | |
parent | 9230fd9e1d33f3db7627efaaf83a1469625665dc (diff) |
Remove redundant address family check -- sam@errno.com
-rw-r--r-- | sys/netinet/ipsec_output.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/sys/netinet/ipsec_output.c b/sys/netinet/ipsec_output.c index a3625c7327b..bc6ce4b09a6 100644 --- a/sys/netinet/ipsec_output.c +++ b/sys/netinet/ipsec_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipsec_output.c,v 1.22 2002/06/09 16:26:11 itojun Exp $ */ +/* $OpenBSD: ipsec_output.c,v 1.23 2002/06/19 22:03:46 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -339,29 +339,25 @@ ipsp_process_done(struct mbuf *m, struct tdb *tdb) #ifdef INET case AF_INET: /* Fix the header length, for AH processing. */ - if (tdb->tdb_dst.sa.sa_family == AF_INET) { - ip = mtod(m, struct ip *); - ip->ip_len = htons(m->m_pkthdr.len); - } + ip = mtod(m, struct ip *); + ip->ip_len = htons(m->m_pkthdr.len); break; #endif /* INET */ #ifdef INET6 case AF_INET6: /* Fix the header length, for AH processing. */ - if (tdb->tdb_dst.sa.sa_family == AF_INET6) { - if (m->m_pkthdr.len < sizeof(*ip6)) { - m_freem(m); - return ENXIO; - } - if (m->m_pkthdr.len - sizeof(*ip6) > IPV6_MAXPACKET) { - /* No jumbogram support. */ - m_freem(m); - return ENXIO; /*?*/ - } - ip6 = mtod(m, struct ip6_hdr *); - ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6)); + if (m->m_pkthdr.len < sizeof(*ip6)) { + m_freem(m); + return ENXIO; } + if (m->m_pkthdr.len - sizeof(*ip6) > IPV6_MAXPACKET) { + /* No jumbogram support. */ + m_freem(m); + return ENXIO; + } + ip6 = mtod(m, struct ip6_hdr *); + ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6)); break; #endif /* INET6 */ |