Changeset View
Changeset View
Standalone View
Standalone View
sbin/dhclient/packet.c
Context not available. | |||||
/* | /* | ||||
* Compute UDP checksums, including the ``pseudo-header'', the | * Compute UDP checksums, including the ``pseudo-header'', the | ||||
* UDP header and the data. If the UDP checksum field is zero, | * UDP header and the data. If the UDP checksum field is zero | ||||
* we're not supposed to do a checksum. | * or 0xffff (offloaded) we're not supposed to do a checksum. | ||||
*/ | */ | ||||
if (!data) { | if (!data) { | ||||
data = buf + bufix + ip_len + sizeof(*udp); | data = buf + bufix + ip_len + sizeof(*udp); | ||||
Context not available. | |||||
IPPROTO_UDP + (u_int32_t)ntohs(udp->uh_ulen))))); | IPPROTO_UDP + (u_int32_t)ntohs(udp->uh_ulen))))); | ||||
udp_packets_seen++; | udp_packets_seen++; | ||||
if (usum && usum != sum) { | if (usum && (u_short)usum != 0xffff && usum != sum) { | ||||
udp_packets_bad_checksum++; | udp_packets_bad_checksum++; | ||||
if (udp_packets_seen > 4 && | if (udp_packets_seen > 4 && | ||||
(udp_packets_seen / udp_packets_bad_checksum) < 2) { | (udp_packets_seen / udp_packets_bad_checksum) < 2) { | ||||
Context not available. |