diff options
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r-- | networking/udhcp/dhcpc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 4d755e6b8..3be09f4d7 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
@@ -739,7 +739,7 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd) | |||
739 | /* verify IP checksum */ | 739 | /* verify IP checksum */ |
740 | check = packet.ip.check; | 740 | check = packet.ip.check; |
741 | packet.ip.check = 0; | 741 | packet.ip.check = 0; |
742 | if (check != udhcp_checksum(&packet.ip, sizeof(packet.ip))) { | 742 | if (check != inet_cksum((uint16_t *)&packet.ip, sizeof(packet.ip))) { |
743 | log1("Bad IP header checksum, ignoring"); | 743 | log1("Bad IP header checksum, ignoring"); |
744 | return -2; | 744 | return -2; |
745 | } | 745 | } |
@@ -750,7 +750,7 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd) | |||
750 | packet.ip.tot_len = packet.udp.len; /* yes, this is needed */ | 750 | packet.ip.tot_len = packet.udp.len; /* yes, this is needed */ |
751 | check = packet.udp.check; | 751 | check = packet.udp.check; |
752 | packet.udp.check = 0; | 752 | packet.udp.check = 0; |
753 | if (check && check != udhcp_checksum(&packet, bytes)) { | 753 | if (check && check != inet_cksum((uint16_t *)&packet, bytes)) { |
754 | log1("Packet with bad UDP checksum received, ignoring"); | 754 | log1("Packet with bad UDP checksum received, ignoring"); |
755 | return -2; | 755 | return -2; |
756 | } | 756 | } |