/* verify IP checksum */
check = packet.ip.check;
packet.ip.check = 0;
- if (check != udhcp_checksum(&packet.ip, sizeof(packet.ip))) {
+ if (check != inet_cksum((uint16_t *)&packet.ip, sizeof(packet.ip))) {
log1("Bad IP header checksum, ignoring");
return -2;
}
packet.ip.tot_len = packet.udp.len; /* yes, this is needed */
check = packet.udp.check;
packet.udp.check = 0;
- if (check && check != udhcp_checksum(&packet, bytes)) {
+ if (check && check != inet_cksum((uint16_t *)&packet, bytes)) {
log1("Packet with bad UDP checksum received, ignoring");
return -2;
}