@@ -244,9 +244,9 @@ static void dhcp_vendor_information_notify(uint8_t *ptr, uint16_t data_len, dhcp
244244
245245 dhcp_server_notify_info_t server_info ;
246246 server_info .life_time = srv_data_ptr -> iaNontemporalAddress .validLifetime ;
247- server_info .duid = srv_data_ptr -> serverDUID .duid ;
247+ server_info .duid = srv_data_ptr -> serverDUID .duid + 2 ; // Skip the type
248248 server_info .duid_type = srv_data_ptr -> serverDUID .type ;
249- server_info .duid_length = srv_data_ptr -> serverDUID .duid_length ;
249+ server_info .duid_length = srv_data_ptr -> serverDUID .duid_length - 2 ; // remove the type
250250
251251 while (data_len >= 4 ) {
252252 type = common_read_16_bit (ptr );
@@ -265,18 +265,19 @@ static void dhcp_vendor_information_notify(uint8_t *ptr, uint16_t data_len, dhcp
265265 dhcp_option .option .vendor_spesific .enterprise_number = common_read_32_bit (ptr );
266266 ptr += 4 ;
267267 data_len -= 4 ;
268+ length -= 4 ;
268269 dhcp_option .option .vendor_spesific .data = ptr ;
269- dhcp_option .option .vendor_spesific .data_length = data_len ;
270+ dhcp_option .option .vendor_spesific .data_length = length ;
270271
271272
272- } else if (type == DHCPV6_OPTION_DNS_SERVERS && (data_len >= 16 && ((data_len % 16 ) == 0 ))) {
273+ } else if (type == DHCPV6_OPTION_DNS_SERVERS && (length >= 16 && ((length % 16 ) == 0 ))) {
273274 valid_optional_options = true;
274275 dhcp_option .option .generic .data = ptr ;
275- dhcp_option .option .generic .data_length = data_len ;
276+ dhcp_option .option .generic .data_length = length ;
276277 } else if (type == DHCPV6_OPTION_DOMAIN_LIST ) {
277278 valid_optional_options = true;
278279 dhcp_option .option .generic .data = ptr ;
279- dhcp_option .option .generic .data_length = data_len ;
280+ dhcp_option .option .generic .data_length = length ;
280281 }
281282 if (valid_optional_options ) {
282283 dhcp_option .option_type = type ;
0 commit comments