@@ -182,12 +182,7 @@ int dhcp_solicit_resp_cb(uint16_t instance_id, void *ptr, uint8_t msg_name, uin
182182
183183 protocol_interface_info_entry_t * cur = protocol_stack_interface_info_get_by_id (dhcp_client .interface );
184184 if (cur ) {
185- ns_list_foreach (if_address_entry_t , e , & cur -> ip_addresses ) {
186- if (memcmp (e -> address , srv_data_ptr -> iaNontemporalAddress .addressPrefix , 16 ) == 0 ) {
187- tr_debug ("Depreacate address %s" , trace_ipv6 (srv_data_ptr -> iaNontemporalAddress .addressPrefix ));
188- addr_lifetime_update (cur , e , 0 , 0 , 30 * 60 ); //Accept max 30 min lifetime
189- }
190- }
185+ addr_deprecate (cur , srv_data_ptr -> iaNontemporalAddress .addressPrefix );
191186 }
192187 }
193188
@@ -233,8 +228,11 @@ int dhcp_client_get_global_address(int8_t interface, uint8_t dhcp_addr[static 16
233228 //Already Created to same interface
234229 if (dhcp_client .one_instance_interface && prefix ) {
235230 if (srv_data_ptr -> iaNonTemporalStructValid ) {
236- srv_data_ptr -> iaNonTemporalStructValid = false;
237- dhcpv6_renew (protocol_stack_interface_info_get_by_id (interface ), NULL , ADDR_CALLBACK_TIMER );
231+ if (memcmp (srv_data_ptr -> iaNontemporalAddress .addressPrefix , prefix , 8 )) {
232+ //Request new address direct from Server if prefix is new
233+ srv_data_ptr -> iaNonTemporalStructValid = false;
234+ dhcpv6_renew (protocol_stack_interface_info_get_by_id (interface ), NULL , ADDR_CALLBACK_TIMER );
235+ }
238236 return 0 ;
239237 }
240238 }
@@ -325,9 +323,11 @@ void dhcp_client_global_address_delete(int8_t interface, uint8_t *dhcp_addr, uin
325323 return ;
326324 }
327325 dhcp_service_req_remove (srv_data_ptr -> transActionId );// remove all pending retransmissions
328- tr_debug ("Deleting address: %s" , trace_ipv6 (srv_data_ptr -> iaNontemporalAddress .addressPrefix ));
329-
330- addr_delete (cur , srv_data_ptr -> iaNontemporalAddress .addressPrefix );
326+ if (dhcp_client .one_instance_interface ) {
327+ addr_deprecate (cur , srv_data_ptr -> iaNontemporalAddress .addressPrefix );
328+ } else {
329+ addr_delete (cur , srv_data_ptr -> iaNontemporalAddress .addressPrefix );
330+ }
331331
332332 libdhcvp6_nontemporalAddress_server_data_free (srv_data_ptr );
333333 srv_data_ptr = libdhcpv6_nonTemporal_entry_get_by_prefix (interface , prefix );
0 commit comments