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
This commit is contained in:
Hajimu UMEMOTO 2001-10-22 12:43:30 +00:00
parent 7c34d28826
commit cb34210012
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85315

View File

@ -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++;