diff options
author | Ron Yorston <rmy@pobox.com> | 2023-12-05 07:44:02 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-12-05 07:44:02 +0000 |
commit | 7dff7f37600209353cf4e86d1cca29bacf5f7372 (patch) | |
tree | fd2d62684e46663ebd435391058dcf8558c6b70d /networking | |
parent | f444dc586b16c104a82d201d3a7caca68affe51b (diff) | |
parent | 28f41260935852eda6bd8ab1f26347c012ae0a53 (diff) | |
download | busybox-w32-7dff7f37600209353cf4e86d1cca29bacf5f7372.tar.gz busybox-w32-7dff7f37600209353cf4e86d1cca29bacf5f7372.tar.bz2 busybox-w32-7dff7f37600209353cf4e86d1cca29bacf5f7372.zip |
Merge branch 'busybox' into mergeFRP-5236-g7dff7f376
Diffstat (limited to 'networking')
-rw-r--r-- | networking/udhcp/d6_dhcpc.c | 1 | ||||
-rw-r--r-- | networking/udhcp/dhcpc.c | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c index cdd06188e..a72fd31bd 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 | |||
961 | d6_dump_packet(&packet.data); | 961 | d6_dump_packet(&packet.data); |
962 | 962 | ||
963 | bytes -= sizeof(packet.ip6) + sizeof(packet.udp); | 963 | bytes -= sizeof(packet.ip6) + sizeof(packet.udp); |
964 | memset(d6_pkt, 0, sizeof(*d6_pkt)); | ||
964 | memcpy(d6_pkt, &packet.data, bytes); | 965 | memcpy(d6_pkt, &packet.data, bytes); |
965 | return bytes; | 966 | return bytes; |
966 | } | 967 | } |
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 | } |