mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
Merge pull request #28138 from pkern/oci-dhcpv6
sd-dhcp6-lease: Ignore invalid bytes at the end of the packet
This commit is contained in:
commit
1d2b93ff89
@ -465,6 +465,11 @@ static int dhcp6_lease_parse_message(
|
|||||||
size_t optlen;
|
size_t optlen;
|
||||||
const uint8_t *optval;
|
const uint8_t *optval;
|
||||||
|
|
||||||
|
if (len - offset < offsetof(DHCP6Option, data)) {
|
||||||
|
log_dhcp6_client(client, "Ignoring %zu invalid byte(s) at the end of the packet", len - offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
r = dhcp6_option_parse(message->options, len, &offset, &optcode, &optlen, &optval);
|
r = dhcp6_option_parse(message->options, len, &offset, &optcode, &optlen, &optval);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_dhcp6_client_errno(client, r,
|
return log_dhcp6_client_errno(client, r,
|
||||||
|
@ -461,6 +461,8 @@ TEST(client_parse_message_issue_24002) {
|
|||||||
0x20, 0x03, 0x00, 0xff, 0xaa, 0xbb, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* prefix */
|
0x20, 0x03, 0x00, 0xff, 0xaa, 0xbb, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* prefix */
|
||||||
/* Rapid commit */
|
/* Rapid commit */
|
||||||
0x00, 0x0e, 0x00, 0x00,
|
0x00, 0x0e, 0x00, 0x00,
|
||||||
|
/* Trailing invalid byte at the end. See issue #28183. */
|
||||||
|
00,
|
||||||
};
|
};
|
||||||
static const uint8_t duid[] = {
|
static const uint8_t duid[] = {
|
||||||
0x00, 0x00, 0xab, 0x11, 0x5c, 0x6b, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
|
0x00, 0x00, 0xab, 0x11, 0x5c, 0x6b, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
|
||||||
|
Loading…
Reference in New Issue
Block a user