diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2001-10-22 12:43:30 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2001-10-22 12:43:30 +0000 |
commit | cb34210012d4e96320eb17964c6d8ebe2423038b (patch) | |
tree | f6d7b6c5d5798206b224c7c75afc11cb3cc39f31 /sys/netinet/udp_usrreq.c | |
parent | 7c34d2882669c6654d27aa8f363a304716a4ce62 (diff) | |
download | src-cb34210012d4e96320eb17964c6d8ebe2423038b.tar.gz src-cb34210012d4e96320eb17964c6d8ebe2423038b.zip |
restore the data of the ip header when extended udp header and data checksum
is calculated. this caused some trouble in the code which the ip header
is not modified. for example, inbound policy lookup failed.
Obtained from: KAME
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=85315
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 463f8b3239e8..809091188aae 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -225,9 +225,12 @@ udp_input(m, off) m->m_pkthdr.csum_data + IPPROTO_UDP)); uh->uh_sum ^= 0xffff; } else { + char b[9]; + bcopy(((struct ipovly *)ip)->ih_x1, b, 9); bzero(((struct ipovly *)ip)->ih_x1, 9); ((struct ipovly *)ip)->ih_len = uh->uh_ulen; uh->uh_sum = in_cksum(m, len + sizeof (struct ip)); + bcopy(b, ((struct ipovly *)ip)->ih_x1, 9); } if (uh->uh_sum) { udpstat.udps_badsum++; |