Modifided logic for wifi_manager_ap_get_ip_address() 08/162908/1 accepted/tizen/unified/20171206.115942 submit/tizen/20171206.064834
authortaesub kim <taesub.kim@samsung.com>
Tue, 5 Dec 2017 23:43:25 +0000 (08:43 +0900)
committertaesub kim <taesub.kim@samsung.com>
Wed, 6 Dec 2017 06:42:46 +0000 (15:42 +0900)
Change-Id: Ib94782398155d056b485531d7c7590b673562ae4
Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
include/wifi-manager.h
src/wifi_ap.c

index b382504..5e2c67f 100755 (executable)
@@ -2272,13 +2272,16 @@ int wifi_manager_ap_set_ip_config_type(wifi_manager_ap_h ap,
  * @remarks You must release @a ip_address using free().
  * @param[in] ap              The access point handle
  * @param[in] address_family  The address family
- * @param[out] ip_address     The IP address
+ * @param[out] ip_address     The IP address; this value is for default address \n
+ *                            e.g, IPv6 can have multiple addresses. but you can only obtain a representative address \n
+ *                            if you want to get all IPv6 address, you can use the wifi_manager_ap_foreach_ipv6_address().
  * @return 0 on success, otherwise negative error value
  * @retval #WIFI_MANAGER_ERROR_NONE                 Successful
  * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER    Invalid parameter
  * @retval #WIFI_MANAGER_ERROR_OUT_OF_MEMORY        Out of memory
  * @retval #WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Address family not supported
  * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED        Not supported
+ * @see  wifi_manager_ap_foreach_ipv6_address()
  */
 int wifi_manager_ap_get_ip_address(wifi_manager_ap_h ap,
                wifi_manager_address_family_e address_family, char **ip_address);
index 44b37ce..1713bf8 100755 (executable)
@@ -864,8 +864,9 @@ EXPORT_API int wifi_manager_ap_get_ip_address(wifi_manager_ap_h ap,
        } else if (address_family == WIFI_MANAGER_ADDRESS_FAMILY_IPV6) {
                if (net_get_preferred_ipv6_address(profile_info->ProfileName, ip_address) != NET_ERR_NONE) {
                        WIFI_LOG(WIFI_ERROR, "Failed to get preferred ipv6 address");
-                       *ip_address = NULL;
-                       return WIFI_MANAGER_ERROR_OPERATION_FAILED;
+                       *ip_address = __ap_convert_ip_to_string(
+                                       &profile_info->net_info.IpAddr6,
+                                       address_family);
                }
        }