From 67bb748cbe66453af8de8e36d6479e66e30040c6 Mon Sep 17 00:00:00 2001 From: Juha Heiskanen Date: Wed, 15 May 2019 09:49:06 +0300 Subject: [PATCH] Codereview cleaning's Change-Id: I86cad0fa3d4d4edc9e4e8342b2f3873c4080239a --- source/6LoWPAN/ws/ws_bootstrap.c | 2 -- source/DHCPv6_client/dhcpv6_client_service.c | 19 +++++++++---------- source/libDHCPv6/dhcp_service_api.c | 1 - 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/source/6LoWPAN/ws/ws_bootstrap.c b/source/6LoWPAN/ws/ws_bootstrap.c index 147843bbb30b..66131e4937fb 100644 --- a/source/6LoWPAN/ws/ws_bootstrap.c +++ b/source/6LoWPAN/ws/ws_bootstrap.c @@ -1669,8 +1669,6 @@ int ws_bootstrap_aro_failure(protocol_interface_info_entry_t *cur, const uint8_t blacklist_update(ll_address, false); rpl_control_neighbor_delete(cur, ll_address); ws_bootstrap_neighbor_remove(cur, ll_address); - //Cancel DHCPV6 If it is active but not finished yest - //dhcp_client_address_cancel(cur->id, NULL); return 0; } diff --git a/source/DHCPv6_client/dhcpv6_client_service.c b/source/DHCPv6_client/dhcpv6_client_service.c index 2d34c2facf8d..d56d06f11840 100644 --- a/source/DHCPv6_client/dhcpv6_client_service.c +++ b/source/DHCPv6_client/dhcpv6_client_service.c @@ -317,20 +317,19 @@ int dhcp_client_server_address_update(int8_t interface, uint8_t prefix[static 16 } else if (dhcp_client.one_instance_interface) { srv_data_ptr = libdhcpv6_nonTemporal_entry_get_by_instance(dhcp_client.libDhcp_instance); } - if (srv_data_ptr) { - if (memcmp(srv_data_ptr->server_address, server_address, 16) == 0) { - return 0; - } + if (!srv_data_ptr) { + return -1; } - if (srv_data_ptr) { - memcpy(srv_data_ptr->server_address, server_address, 16); - if (!srv_data_ptr->iaNonTemporalStructValid) { - dhcp_service_update_server_address(srv_data_ptr->transActionId, server_address); - } + if (memcmp(srv_data_ptr->server_address, server_address, 16) == 0) { return 0; } - return -1; + + memcpy(srv_data_ptr->server_address, server_address, 16); + if (!srv_data_ptr->iaNonTemporalStructValid) { + dhcp_service_update_server_address(srv_data_ptr->transActionId, server_address); + } + return 0; } diff --git a/source/libDHCPv6/dhcp_service_api.c b/source/libDHCPv6/dhcp_service_api.c index f729d1c0ee16..b784904dd87f 100644 --- a/source/libDHCPv6/dhcp_service_api.c +++ b/source/libDHCPv6/dhcp_service_api.c @@ -755,7 +755,6 @@ void dhcp_service_update_server_address(uint32_t msg_tr_id, uint8_t *server_addr msg_tr_ptr = dhcp_tr_find(msg_tr_id); if (msg_tr_ptr != NULL) { - tr_debug("Set New Server address %s", trace_ipv6(server_address)); memcpy(msg_tr_ptr->addr.address, server_address, 16); } }