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 e13eb3f9f..66aa38c20 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
@@ -935,7 +935,7 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd) | |||
935 | /* verify IP checksum */ | 935 | /* verify IP checksum */ |
936 | check = packet.ip.check; | 936 | check = packet.ip.check; |
937 | packet.ip.check = 0; | 937 | packet.ip.check = 0; |
938 | if (check != inet_cksum((uint16_t *)&packet.ip, sizeof(packet.ip))) { | 938 | if (check != inet_cksum(&packet.ip, sizeof(packet.ip))) { |
939 | log1s("bad IP header checksum, ignoring"); | 939 | log1s("bad IP header checksum, ignoring"); |
940 | return -2; | 940 | return -2; |
941 | } | 941 | } |
@@ -960,7 +960,7 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd) | |||
960 | packet.ip.tot_len = packet.udp.len; /* yes, this is needed */ | 960 | packet.ip.tot_len = packet.udp.len; /* yes, this is needed */ |
961 | check = packet.udp.check; | 961 | check = packet.udp.check; |
962 | packet.udp.check = 0; | 962 | packet.udp.check = 0; |
963 | if (check && check != inet_cksum((uint16_t *)&packet, bytes)) { | 963 | if (check && check != inet_cksum(&packet, bytes)) { |
964 | log1s("packet with bad UDP checksum received, ignoring"); | 964 | log1s("packet with bad UDP checksum received, ignoring"); |
965 | return -2; | 965 | return -2; |
966 | } | 966 | } |