diff options
author | glebius <glebius@FreeBSD.org> | 2012-10-14 15:08:07 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2012-10-14 15:08:07 +0000 |
commit | b6c0be02b602a88e78c803ae09a17ed647c0af63 (patch) | |
tree | e1e57f6c7af35095499b12413a88122dbc1e98cf /sys/netinet | |
parent | 68efa562f98219a9a89775c55a62fc7ccad6cf6e (diff) | |
download | FreeBSD-src-b6c0be02b602a88e78c803ae09a17ed647c0af63.zip FreeBSD-src-b6c0be02b602a88e78c803ae09a17ed647c0af63.tar.gz |
Fix a miss from r241344: in ip_mloopback() we need to go to
net byte order prior to calling in_delayed_cksum().
Reported by: Olivier Cochard-Labbe <olivier cochard.me>
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_output.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index e82a0ac..65e5518 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1313,6 +1313,9 @@ ip_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in *dst, if (copym != NULL && (copym->m_flags & M_EXT || copym->m_len < hlen)) copym = m_pullup(copym, hlen); if (copym != NULL) { + ip = mtod(copym, struct ip *); + ip->ip_len = htons(ip->ip_len); + ip->ip_off = htons(ip->ip_off); /* If needed, compute the checksum and mark it as valid. */ if (copym->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { in_delayed_cksum(copym); @@ -1325,9 +1328,6 @@ ip_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in *dst, * We don't bother to fragment if the IP length is greater * than the interface's MTU. Can this possibly matter? */ - ip = mtod(copym, struct ip *); - ip->ip_len = htons(ip->ip_len); - ip->ip_off = htons(ip->ip_off); ip->ip_sum = 0; ip->ip_sum = in_cksum(copym, hlen); #if 1 /* XXX */ |