dhcp6: add missing option length check

Closes #13578.
This commit is contained in:
Yu Watanabe 2019-09-17 22:18:49 +09:00 committed by Frantisek Sumsal
parent 59a224d728
commit 6ffe71d0e2
2 changed files with 5 additions and 2 deletions

View file

@ -29,8 +29,8 @@
#define MAX_MAC_ADDR_LEN INFINIBAND_ALEN
#define IRT_DEFAULT 1 * USEC_PER_DAY
#define IRT_MINIMUM 600 * USEC_PER_SEC
#define IRT_DEFAULT (1 * USEC_PER_DAY)
#define IRT_MINIMUM (600 * USEC_PER_SEC)
/* what to request from the server, addresses (IA_NA) and/or prefixes (IA_PD) */
enum {
@ -1002,6 +1002,9 @@ static int client_parse_message(
break;
case SD_DHCP6_OPTION_INFORMATION_REFRESH_TIME:
if (optlen != 4)
return -EINVAL;
irt = be32toh(*(be32_t *) optval) * USEC_PER_SEC;
break;
}

Binary file not shown.