| version 1.61, 2000/02/11 10:43:36 |
version 1.62, 2000/02/29 16:21:56 |
| Line 240 udp_input(m, va_alist) |
|
| Line 240 udp_input(m, va_alist) |
|
| * Checksum extended UDP header and data. |
* Checksum extended UDP header and data. |
| */ |
*/ |
| if (uh->uh_sum) { |
if (uh->uh_sum) { |
| #ifndef PULLDOWN_TEST |
|
| struct ip save_ip; |
|
| |
|
| /* |
|
| * Save a copy of the IP header in case we want restore it |
|
| * for sending an ICMP error message in response. |
|
| */ |
|
| save_ip = *ip; |
|
| |
|
| bzero(((struct ipovly *)ip)->ih_x1, |
|
| sizeof ((struct ipovly *)ip)->ih_x1); |
|
| ((struct ipovly *)ip)->ih_len = uh->uh_ulen; |
|
| if (in_cksum(m, len + sizeof (struct ip)) != 0) { |
|
| udpstat.udps_badsum++; |
|
| m_freem(m); |
|
| return; |
|
| } |
|
| |
|
| *ip = save_ip; |
|
| #else |
|
| if (in4_cksum(m, IPPROTO_UDP, iphlen, len) != 0) { |
if (in4_cksum(m, IPPROTO_UDP, iphlen, len) != 0) { |
| udpstat.udps_badsum++; |
udpstat.udps_badsum++; |
| m_freem(m); |
m_freem(m); |
| return; |
return; |
| } |
} |
| #endif |
|
| } |
} |
| |
|
| /* construct source and dst sockaddrs. */ |
/* construct source and dst sockaddrs. */ |