From: jnashok Date: Tue, 26 May 2015 07:32:51 +0000 (+0900) Subject: [Jira] IOT-529, Fix to support multiple IP networks in Android X-Git-Tag: 1.2.0+RC1~1671 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a85a55057b3aa5b7e19a89b6728444ef158d3ed4;p=platform%2Fupstream%2Fiotivity.git [Jira] IOT-529, Fix to support multiple IP networks in Android currently only one IP network is enabled due to the bug Change-Id: I878dec13ec7e4da6a5b2867d8b3c28fb99d85530 Signed-off-by: jnashok Reviewed-on: https://gerrit.iotivity.org/gerrit/1107 Tested-by: jenkins-iotivity Reviewed-by: Ashok Babu Channa Reviewed-by: John Light Reviewed-by: Erich Keane --- diff --git a/resource/csdk/connectivity/src/ip_adapter/android/caipnwmonitor.c b/resource/csdk/connectivity/src/ip_adapter/android/caipnwmonitor.c index 4272e65..85795f4 100644 --- a/resource/csdk/connectivity/src/ip_adapter/android/caipnwmonitor.c +++ b/resource/csdk/connectivity/src/ip_adapter/android/caipnwmonitor.c @@ -241,6 +241,12 @@ static CAResult_t CAIPUpdateInterfaceInformation(u_arraylist_t **netInterfaceLis OIC_LOG_V(DEBUG, IP_MONITOR_TAG, "CAIPUpdateInterfaceInformation : %d", interfaces); + if(0 == interfaces) + { + OIC_LOG(ERROR, IP_MONITOR_TAG, "no interfaces"); + return CA_STATUS_FAILED; + } + for (int32_t i = 0; i < interfaces; i++) { struct ifreq temp_ifr = { 0 }; @@ -263,6 +269,8 @@ static CAResult_t CAIPUpdateInterfaceInformation(u_arraylist_t **netInterfaceLis if ((temp_ifr.ifr_flags & IFF_LOOPBACK) || !(temp_ifr.ifr_flags & IFF_UP) || !(temp_ifr.ifr_flags & IFF_RUNNING)) { + OIC_LOG_V(ERROR, IP_MONITOR_TAG, + "interface is not up or not running or loopback = %x", temp_ifr.ifr_flags); continue; } @@ -326,15 +334,11 @@ static CAResult_t CAIPUpdateInterfaceInformation(u_arraylist_t **netInterfaceLis OIC_LOG_V(DEBUG, IP_MONITOR_TAG, "ipAddress : %s, interfaceName : %s, subnetmask : %s", netInfo->ipAddress, netInfo->interfaceName, netInfo->subnetMask); - close(sck); - return CA_STATUS_OK; - - break; } close(sck); OIC_LOG(DEBUG, IP_MONITOR_TAG, "OUT"); - return CA_STATUS_FAILED; + return CA_STATUS_OK; } static bool CACheckIsAnyInterfaceDown(const u_arraylist_t *netInterfaceList,