Move htons() ip_len to after the in_delayed_cksum() call.

This should stop cksum error messages on IPsec communication
which was reported on freebsd-current.

Reviewed by: jlemon
This commit is contained in:
shin 2000-04-02 16:18:26 +00:00
parent 484d3fa1b1
commit 7a67542f8a

View File

@ -688,11 +688,6 @@ ip_output(m0, opt, ro, flags, imo)
default:
printf("ip_output: Invalid policy found. %d\n", sp->policy);
}
ip->ip_len = htons((u_short)ip->ip_len);
ip->ip_off = htons((u_short)ip->ip_off);
ip->ip_sum = 0;
{
struct ipsec_output_state state;
bzero(&state, sizeof(state));
@ -704,6 +699,8 @@ ip_output(m0, opt, ro, flags, imo)
state.ro = ro;
state.dst = (struct sockaddr *)dst;
ip->ip_sum = 0;
/*
* XXX
* delayed checksums are not currently compatible with IPsec
@ -713,6 +710,9 @@ ip_output(m0, opt, ro, flags, imo)
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
}
ip->ip_len = htons((u_short)ip->ip_len);
ip->ip_off = htons((u_short)ip->ip_off);
error = ipsec4_output(&state, sp, flags);
m = state.m;