aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_output.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 4f5d8b7279ba..9317d5d57e1d 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -667,26 +667,19 @@ again:
sendit:
#if defined(IPSEC) || defined(IPSEC_SUPPORT)
if (IPSEC_ENABLED(ipv4)) {
- struct mbuf *m1;
+ struct ip ip_hdr;
- error = mb_unmapped_to_ext(m, &m1);
- if (error != 0) {
- if (error == ENOMEM) {
- IPSTAT_INC(ips_odropped);
- error = ENOBUFS;
- goto bad;
- }
- /* XXXKIB */
- goto no_ipsec;
- }
- m = m1;
if ((error = IPSEC_OUTPUT(ipv4, ifp, m, inp, mtu)) != 0) {
if (error == EINPROGRESS)
error = 0;
goto done;
}
-no_ipsec:;
+
+ /* Update variables that are affected by ipsec4_output(). */
+ m_copydata(m, 0, sizeof(ip_hdr), (char *)&ip_hdr);
+ hlen = ip_hdr.ip_hl << 2;
}
+
/*
* Check if there was a route for this packet; return error if not.
*/
@@ -695,9 +688,6 @@ no_ipsec:;
error = EHOSTUNREACH;
goto bad;
}
- /* Update variables that are affected by ipsec4_output(). */
- ip = mtod(m, struct ip *);
- hlen = ip->ip_hl << 2;
#endif /* IPSEC */
/* Jump over all PFIL processing if hooks are not active. */