aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r--networking/udhcp/dhcpc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 200a2fb8a..07e2eadfe 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -966,7 +966,7 @@ static NOINLINE int d4_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
966 check = packet.udp.check; 966 check = packet.udp.check;
967 packet.udp.check = 0; 967 packet.udp.check = 0;
968 if (check && check != inet_cksum(&packet, bytes)) { 968 if (check && check != inet_cksum(&packet, bytes)) {
969 log1s("packet with bad UDP checksum received, ignoring"); 969 log1s("packet with bad UDP checksum, ignoring");
970 return -2; 970 return -2;
971 } 971 }
972 skip_udp_sum_check: 972 skip_udp_sum_check:
@@ -981,6 +981,7 @@ static NOINLINE int d4_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
981 udhcp_dump_packet(&packet.data); 981 udhcp_dump_packet(&packet.data);
982 982
983 bytes -= sizeof(packet.ip) + sizeof(packet.udp); 983 bytes -= sizeof(packet.ip) + sizeof(packet.udp);
984 memset(dhcp_pkt, 0, sizeof(*dhcp_pkt));
984 memcpy(dhcp_pkt, &packet.data, bytes); 985 memcpy(dhcp_pkt, &packet.data, bytes);
985 return bytes; 986 return bytes;
986} 987}