Lines Matching refs:sum
65 uint32_t sum = startsum; in checksum() local
69 sum += *up++; in checksum()
73 sum += (uint16_t) *(uint8_t *)up; in checksum()
75 while ((upper16 = (sum >> 16)) != 0) { in checksum()
76 sum = (sum & 0xffff) + upper16; in checksum()
78 return sum; in checksum()
81 static uint32_t finish_sum(uint32_t sum) in finish_sum() argument
83 return ~sum & 0xffff; in finish_sum()
163 uint32_t sum; in receive_packet() local
207 sum = finish_sum(checksum(&packet.ip, sizeof(packet.ip), 0)); in receive_packet()
208 if (sum != 0) { in receive_packet()
242 sum = finish_sum(checksum(&packet, nread, 0)); in receive_packet()
244 if (!sum) in receive_packet()
245 sum = finish_sum(sum); in receive_packet()
246 if (temp != sum) { in receive_packet()
247 ALOGW("UDP header checksum failure (0x%x should be 0x%x)", sum, temp); in receive_packet()