summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
Diffstat (limited to 'networking')
-rw-r--r--networking/udhcp/d6_dhcpc.c1
-rw-r--r--networking/udhcp/dhcpc.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c
index cdd0618..a72fd31 100644
--- a/networking/udhcp/d6_dhcpc.c
+++ b/networking/udhcp/d6_dhcpc.c
@@ -961,6 +961,7 @@ static NOINLINE int d6_recv_raw_packet(struct in6_addr *peer_ipv6, struct d6_pac
d6_dump_packet(&packet.data);
bytes -= sizeof(packet.ip6) + sizeof(packet.udp);
+ memset(d6_pkt, 0, sizeof(*d6_pkt));
memcpy(d6_pkt, &packet.data, bytes);
return bytes;
}
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 200a2fb..07e2ead 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)
check = packet.udp.check;
packet.udp.check = 0;
if (check && check != inet_cksum(&packet, bytes)) {
- log1s("packet with bad UDP checksum received, ignoring");
+ log1s("packet with bad UDP checksum, ignoring");
return -2;
}
skip_udp_sum_check:
@@ -981,6 +981,7 @@ static NOINLINE int d4_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
udhcp_dump_packet(&packet.data);
bytes -= sizeof(packet.ip) + sizeof(packet.udp);
+ memset(dhcp_pkt, 0, sizeof(*dhcp_pkt));
memcpy(dhcp_pkt, &packet.data, bytes);
return bytes;
}