Fix gcc9 warning
[platform/core/api/connection.git] / src / connection_profile.c
index b63afdd..9fdd65b 100755 (executable)
@@ -266,18 +266,18 @@ EXPORT_API int connection_profile_create(connection_profile_type_e type, const c
 
        int rv  = _connection_libnet_check_profile_privilege();
        if (rv == CONNECTION_ERROR_PERMISSION_DENIED) {
-               CONN_UNLOCK;
-               return rv;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return rv; //LCOV_EXCL_LINE
        } else if (rv != CONNECTION_ERROR_NONE) {
                CONNECTION_LOG(CONNECTION_ERROR, "Failed to create profile"); //LCOV_EXCL_LINE
-               CONN_UNLOCK;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
                return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        net_profile_info_t *profile_info = g_try_malloc0(sizeof(net_profile_info_t));
        if (profile_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        if (type == CONNECTION_PROFILE_TYPE_CELLULAR) {
@@ -331,8 +331,8 @@ EXPORT_API int connection_profile_clone(connection_profile_h* cloned_profile, co
 
        *cloned_profile = g_try_malloc0(sizeof(net_profile_info_t));
        if (*cloned_profile == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        memcpy(*cloned_profile, origin_profile, sizeof(net_profile_info_t));
@@ -358,16 +358,16 @@ EXPORT_API int connection_profile_get_id(connection_profile_h profile, char** pr
 
        char *prof_id = strrchr(profile_info->ProfileName, '/');
        if (prof_id == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_INVALID_PARAMETER;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
        }
 
        prof_id++;
        *profile_id = g_strdup(prof_id);
 
        if (*profile_id == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -401,8 +401,8 @@ EXPORT_API int connection_profile_get_name(connection_profile_h profile, char**
        case NET_DEVICE_BLUETOOTH: {
                char *bt_name = strrchr(profile_info->ProfileName, '/');
                if (bt_name == NULL) {
-                       CONN_UNLOCK;
-                       return CONNECTION_ERROR_INVALID_PARAMETER;
+                       CONN_UNLOCK; //LCOV_EXCL_LINE
+                       return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
                }
 
                bt_name++;
@@ -412,13 +412,13 @@ EXPORT_API int connection_profile_get_name(connection_profile_h profile, char**
                *profile_name = g_strdup(profile_info->ProfileInfo.Mesh.essid);
                break;
        default:
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_INVALID_PARAMETER;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
        }
 
        if (*profile_name == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -456,9 +456,9 @@ EXPORT_API int connection_profile_get_type(connection_profile_h profile, connect
                *type = CONNECTION_PROFILE_TYPE_MESH;
                break;
        default:
-               CONNECTION_LOG(CONNECTION_ERROR, "Invalid profile type");
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid profile type"); //LCOV_EXCL_LINE
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -480,14 +480,14 @@ EXPORT_API int connection_profile_get_network_interface_name(connection_profile_
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_INVALID_PARAMETER;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
        }
 
        *interface_name = g_strdup(net_info->DevName);
        if (*interface_name == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -514,11 +514,11 @@ EXPORT_API int connection_profile_refresh(connection_profile_h profile)
        rv = net_get_profile_info(NULL, profile_info->ProfileName, &profile_info_local);
        if (rv == NET_ERR_ACCESS_DENIED) {
                CONNECTION_LOG(CONNECTION_ERROR, "Access denied"); //LCOV_EXCL_LINE
-               CONN_UNLOCK;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
                return CONNECTION_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
        } else if (rv != NET_ERR_NONE) {
                CONNECTION_LOG(CONNECTION_ERROR, "Failed to get profile information"); //LCOV_EXCL_LINE
-               CONN_UNLOCK;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
                return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
@@ -591,8 +591,8 @@ EXPORT_API int connection_profile_get_ip_config_type(connection_profile_h profil
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
@@ -673,8 +673,8 @@ EXPORT_API int connection_profile_get_ip_address(connection_profile_h profile,
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4) {
@@ -682,15 +682,15 @@ EXPORT_API int connection_profile_get_ip_address(connection_profile_h profile,
                                address_family);
        } else {
                if (net_get_preferred_ipv6_address(net_info->ProfileName, ip_address) != NET_ERR_NONE) {
-                       CONNECTION_LOG(CONNECTION_ERROR, "Failed to get preferred ipv6 address");
-                       *ip_address = __profile_convert_ip_to_string(&net_info->IpAddr6,
+                       CONNECTION_LOG(CONNECTION_ERROR, "Failed to get preferred ipv6 address"); //LCOV_EXCL_LINE
+                       *ip_address = __profile_convert_ip_to_string(&net_info->IpAddr6, //LCOV_EXCL_LINE
                                        address_family);
                }
        }
 
        if (*ip_address == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -714,25 +714,25 @@ EXPORT_API int connection_profile_get_subnet_mask(connection_profile_h profile,
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
-               CONNECTION_LOG(CONNECTION_ERROR,
+               CONNECTION_LOG(CONNECTION_ERROR, //LCOV_EXCL_LINE
                                "Please uses connection_profile_get_prefix_length()");
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_NOT_SUPPORTED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
        }
 
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        *subnet_mask = __profile_convert_ip_to_string(&net_info->SubnetMask,
                                address_family);
 
        if (*subnet_mask == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -758,8 +758,8 @@ EXPORT_API int connection_profile_get_gateway_address(connection_profile_h profi
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6)
@@ -770,8 +770,8 @@ EXPORT_API int connection_profile_get_gateway_address(connection_profile_h profi
                                        &net_info->GatewayAddr, address_family);
 
        if (*gateway_address == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -803,8 +803,8 @@ EXPORT_API int connection_profile_get_dhcp_server_address(
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        CONNECTION_LOG(CONNECTION_INFO, "IP Config %d, DHCP Server Address %s",
@@ -814,8 +814,8 @@ EXPORT_API int connection_profile_get_dhcp_server_address(
                        address_family);
 
        if (*dhcp_server == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -848,8 +848,8 @@ EXPORT_API int connection_profile_get_dhcp_lease_duration(
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        CONNECTION_LOG(CONNECTION_INFO, "Lease duration : %d",
@@ -882,8 +882,8 @@ EXPORT_API int connection_profile_get_dns_address(connection_profile_h profile,
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
@@ -894,8 +894,8 @@ EXPORT_API int connection_profile_get_dns_address(connection_profile_h profile,
                                address_family);
 
        if (*dns_address == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -917,8 +917,8 @@ EXPORT_API int connection_profile_get_proxy_type(connection_profile_h profile, c
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        //LCOV_EXCL_START
@@ -977,15 +977,15 @@ EXPORT_API int connection_profile_get_proxy_address(connection_profile_h profile
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        *proxy_address = g_strdup(net_info->ProxyAddr);
 
        if (*proxy_address == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -1012,8 +1012,8 @@ EXPORT_API int connection_profile_set_ip_config_type(connection_profile_h profil
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
@@ -1100,8 +1100,8 @@ EXPORT_API int connection_profile_set_ip_address(connection_profile_h profile,
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
@@ -1117,8 +1117,8 @@ EXPORT_API int connection_profile_set_ip_address(connection_profile_h profile,
                if (ip_address == NULL)
                        net_info->IpAddr.Data.Ipv4.s_addr = 0;
                else if (inet_pton(AF_INET, ip_address, &net_info->IpAddr.Data.Ipv4) < 1) {
-                       CONN_UNLOCK;
-                       return CONNECTION_ERROR_INVALID_PARAMETER;
+                       CONN_UNLOCK; //LCOV_EXCL_LINE
+                       return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
                }
        }
 
@@ -1142,31 +1142,31 @@ EXPORT_API int connection_profile_set_subnet_mask(connection_profile_h profile,
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
-               CONNECTION_LOG(CONNECTION_ERROR,
+               CONNECTION_LOG(CONNECTION_ERROR, //LCOV_EXCL_LINE
                                "Please uses connection_profile_set_prefix_length()");
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_NOT_SUPPORTED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
        }
 
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (subnet_mask == NULL)
                net_info->SubnetMask.Data.Ipv4.s_addr = 0;
        else if (inet_pton(AF_INET, subnet_mask , &net_info->SubnetMask.Data.Ipv4) < 1) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_INVALID_PARAMETER;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
        }
 
        net_info->PrefixLen = __profile_convert_netmask_to_prefix_len(subnet_mask);
        if (net_info->PrefixLen <= 0 || net_info->PrefixLen > 31) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Invalid Prefix length: %d", net_info->PrefixLen);
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_INVALID_PARAMETER;
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid Prefix length: %d", net_info->PrefixLen); //LCOV_EXCL_LINE
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -1191,8 +1191,8 @@ EXPORT_API int connection_profile_set_gateway_address(connection_profile_h profi
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
@@ -1208,8 +1208,8 @@ EXPORT_API int connection_profile_set_gateway_address(connection_profile_h profi
                if (gateway_address == NULL)
                        net_info->GatewayAddr.Data.Ipv4.s_addr = 0;
                else if (inet_pton(AF_INET, gateway_address, &(net_info->GatewayAddr.Data.Ipv4)) < 1) {
-                       CONN_UNLOCK;
-                       return CONNECTION_ERROR_INVALID_PARAMETER;
+                       CONN_UNLOCK; //LCOV_EXCL_LINE
+                       return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
                }
        }
 
@@ -1237,8 +1237,8 @@ EXPORT_API int connection_profile_set_dns_address(connection_profile_h profile,
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6) {
@@ -1258,8 +1258,8 @@ EXPORT_API int connection_profile_set_dns_address(connection_profile_h profile,
                if (dns_address == NULL)
                        net_info->DnsAddr[order-1].Data.Ipv4.s_addr = 0;
                else if (inet_pton(AF_INET, dns_address, &(net_info->DnsAddr[order-1].Data.Ipv4)) < 1) {
-                       CONN_UNLOCK;
-                       return CONNECTION_ERROR_INVALID_PARAMETER;
+                       CONN_UNLOCK; //LCOV_EXCL_LINE
+                       return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
                }
                if (net_info->DnsCount < order)
                        net_info->DnsCount = order;
@@ -1284,8 +1284,8 @@ EXPORT_API int connection_profile_set_proxy_type(connection_profile_h profile, c
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        switch (type) {
@@ -1326,8 +1326,8 @@ EXPORT_API int connection_profile_set_proxy_address(connection_profile_h profile
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (proxy_address == NULL)
@@ -1357,7 +1357,7 @@ EXPORT_API int connection_profile_set_state_changed_cb(connection_profile_h prof
                return CONNECTION_ERROR_NONE;
        }
 
-       CONN_UNLOCK;
+       CONN_UNLOCK; //LCOV_EXCL_LINE
        return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
 }
 
@@ -1374,8 +1374,8 @@ EXPORT_API int connection_profile_unset_state_changed_cb(connection_profile_h pr
        }
 
        if (_connection_libnet_remove_from_profile_cb_list(profile) != true) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_INVALID_PARAMETER;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -1410,8 +1410,8 @@ EXPORT_API int connection_profile_get_wifi_essid(connection_profile_h profile, c
                *essid = g_strdup(profile_info->ProfileInfo.Mesh.essid);
 
        if (*essid == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -1444,8 +1444,8 @@ EXPORT_API int connection_profile_get_wifi_bssid(connection_profile_h profile, c
                *bssid = g_strdup(profile_info->ProfileInfo.Mesh.bssid);
 
        if (*bssid == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -1659,9 +1659,9 @@ EXPORT_API int connection_profile_is_wifi_passphrase_required(connection_profile
        }
 
        if (profile_info->Favourite) {
-               *required = false;
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_NONE;
+               *required = false; //LCOV_EXCL_LINE
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_NONE; //LCOV_EXCL_LINE
        }
 
        if (profile_info->profile_type == NET_DEVICE_WIFI)
@@ -1777,7 +1777,7 @@ EXPORT_API int connection_profile_get_cellular_service_type(connection_profile_h
 
        if (*type == CONNECTION_CELLULAR_SERVICE_TYPE_UNKNOWN) {
                CONNECTION_LOG(CONNECTION_ERROR, "Invalid service type Passed"); //LCOV_EXCL_LINE
-               CONN_UNLOCK;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
                return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
@@ -1801,14 +1801,14 @@ EXPORT_API int connection_profile_get_cellular_apn(connection_profile_h profile,
 
        if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
                CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter"); //LCOV_EXCL_LINE
-               CONN_UNLOCK;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
                return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
        }
 
        *apn = g_strdup(profile_info->ProfileInfo.Pdp.Apn);
        if (*apn == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -1856,14 +1856,14 @@ EXPORT_API int connection_profile_get_cellular_auth_info(connection_profile_h pr
 
        *user_name = g_strdup(profile_info->ProfileInfo.Pdp.AuthInfo.UserName);
        if (*user_name == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        *password = g_strdup(profile_info->ProfileInfo.Pdp.AuthInfo.Password);
        if (*password == NULL) {
                g_free(*user_name); //LCOV_EXCL_LINE
-               CONN_UNLOCK;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
                return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
@@ -1893,8 +1893,8 @@ EXPORT_API int connection_profile_get_cellular_home_url(connection_profile_h pro
 
        *home_url = g_strdup(profile_info->ProfileInfo.Pdp.HomeURL);
        if (*home_url == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OUT_OF_MEMORY;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
        }
 
        CONN_UNLOCK;
@@ -2363,10 +2363,6 @@ EXPORT_API int connection_profile_get_ipv6_state(connection_profile_h profile, c
 
        net_profile_info_t *profile_info = profile;
        *state = _profile_convert_to_cp_state(profile_info->ProfileState6);
-       if (*state < 0) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
-       }
 
        CONN_UNLOCK;
        return CONNECTION_ERROR_NONE;
@@ -2390,9 +2386,9 @@ EXPORT_API int connection_profile_set_dns_config_type(connection_profile_h profi
                                address_family != CONNECTION_ADDRESS_FAMILY_IPV6) ||
                        (type != CONNECTION_DNS_CONFIG_TYPE_STATIC &&
                         type != CONNECTION_DNS_CONFIG_TYPE_DYNAMIC)) {
-               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_INVALID_PARAMETER;
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter"); //LCOV_EXCL_LINE
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
        }
 
        net_dns_config_type_t *profileType = NULL;
@@ -2401,8 +2397,8 @@ EXPORT_API int connection_profile_set_dns_config_type(connection_profile_h profi
 
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4) {
@@ -2442,8 +2438,8 @@ EXPORT_API int connection_profile_get_dns_config_type(connection_profile_h profi
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)
@@ -2486,8 +2482,8 @@ EXPORT_API int connection_profile_set_prefix_length(connection_profile_h profile
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4) {
@@ -2520,8 +2516,8 @@ EXPORT_API int connection_profile_get_prefix_length(connection_profile_h profile
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL) {
-               CONN_UNLOCK;
-               return CONNECTION_ERROR_OPERATION_FAILED;
+               CONN_UNLOCK; //LCOV_EXCL_LINE
+               return CONNECTION_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV4)