diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/dhcpv6.c | 5 | ||||
-rw-r--r-- | net/dhcpv6.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/net/dhcpv6.c b/net/dhcpv6.c index 0d1c600632f..73a1067877c 100644 --- a/net/dhcpv6.c +++ b/net/dhcpv6.c @@ -316,6 +316,11 @@ static void dhcp6_parse_options(uchar *rx_pkt, unsigned int len) option_ptr = ((uchar *)option_hdr) + sizeof(struct dhcp6_hdr); option_len = ntohs(option_hdr->option_len); + if (option_ptr + option_len > rx_pkt + len) { + debug("Invalid option length\n"); + return; + } + switch (ntohs(option_hdr->option_id)) { case DHCP6_OPTION_CLIENTID: if (memcmp(option_ptr, sm_params.duid, option_len) diff --git a/net/dhcpv6.h b/net/dhcpv6.h index 80ca5204325..65c8e4c71d3 100644 --- a/net/dhcpv6.h +++ b/net/dhcpv6.h @@ -38,7 +38,7 @@ #define DUID_MAX_SIZE DUID_LL_SIZE /* only supports DUID-LL currently */ /* vendor-class-data to send in vendor clas option */ -#define DHCP6_VCI_STRING "U-boot" +#define DHCP6_VCI_STRING "U-Boot" #define DHCP6_MULTICAST_ADDR "ff02::1:2" /* DHCP multicast address */ |