[Tizen]change flag which used for detect ip changed 37/105537/1 accepted/tizen/3.0/common/20161219.113747 accepted/tizen/3.0/ivi/20161219.095709 accepted/tizen/3.0/mobile/20161219.091514 accepted/tizen/3.0/tv/20161219.095715 accepted/tizen/3.0/wearable/20161219.091122 submit/tizen_3.0/20161219.033311
authorbg.chun <bg.chun@samsung.com>
Wed, 14 Dec 2016 08:41:26 +0000 (17:41 +0900)
committerJooseok Park <jooseok.park@samsung.com>
Mon, 19 Dec 2016 03:18:03 +0000 (12:18 +0900)
change netlink interface flags to addr flags
which used for detect network IPv4/6 changed

Change-Id: I827db082879aafdc3e8bd688917180af09531ab2
Signed-off-by: bg.chun <bg.chun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15595
Reviewed-by: Hyuna Jo <hyuna0213.jo@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
packaging/iotivity.spec
resource/csdk/connectivity/src/ip_adapter/tizen/caipnwmonitor.c

index 7cf4901..5a0e919 100644 (file)
@@ -27,6 +27,10 @@ Source1002: %{name}-test.manifest
 %define TARGET_TRANSPORT IP
 %endif
 
+%if "%{TARGET_OS}" == "tizen"
+%define TARGET_TRANSPORT IP
+%endif
+
 %define JOB "-j4"
 %if 0%{?speedpython}
 %define JOB %{?_smp_mflags}
index 4b16863..5fbdc3a 100644 (file)
@@ -164,13 +164,12 @@ u_arraylist_t *CAFindInterfaceChange()
 
     for (struct nlmsghdr *nh = (struct nlmsghdr *)buf; NLMSG_OK(nh, len); nh = NLMSG_NEXT(nh, len))
     {
-        if (nh != NULL && nh->nlmsg_type != RTM_NEWLINK)
+        if (nh != NULL && (nh->nlmsg_type != RTM_DELADDR && nh->nlmsg_type != RTM_NEWADDR))
         {
             continue;
         }
         struct ifinfomsg *ifi = (struct ifinfomsg *)NLMSG_DATA(nh);
-
-        if ((!ifi || (ifi->ifi_flags & IFF_LOOPBACK) || !(ifi->ifi_flags & IFF_RUNNING)))
+        if (!ifi)
         {
             continue;
         }
@@ -178,7 +177,6 @@ u_arraylist_t *CAFindInterfaceChange()
         int ifiIndex = ifi->ifi_index;
 
         iflist = CAIPGetInterfaceInformation(ifiIndex);
-
         if (!iflist)
         {
             OIC_LOG_V(ERROR, TAG, "get interface info failed: %s", strerror(errno));