Lines Matching refs:sum
68 uint32_t sum = startsum; in checksum() local
72 sum += *up++; in checksum()
76 sum += (uint16_t) *(uint8_t *)up; in checksum()
78 while ((upper16 = (sum >> 16)) != 0) { in checksum()
79 sum = (sum & 0xffff) + upper16; in checksum()
81 return sum; in checksum()
84 static uint32_t finish_sum(uint32_t sum) in finish_sum() argument
86 return ~sum & 0xffff; in finish_sum()
166 uint32_t sum; in receive_packet() local
210 sum = finish_sum(checksum(&packet.ip, sizeof(packet.ip), 0)); in receive_packet()
211 if (sum != 0) { in receive_packet()
245 sum = finish_sum(checksum(&packet, nread, 0)); in receive_packet()
247 if (!sum) in receive_packet()
248 sum = finish_sum(sum); in receive_packet()
249 if (temp != sum) { in receive_packet()
250 ALOGW("UDP header checksum failure (0x%x should be 0x%x)", sum, temp); in receive_packet()