Add CAcloseSslConnectionAll method in IP adapter changed logic
authorjihwan.seo <jihwan.seo@samsung.com>
Mon, 19 Dec 2016 10:30:51 +0000 (19:30 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Thu, 22 Dec 2016 10:51:10 +0000 (10:51 +0000)
since session should be cleared when adapter related IP status is disabled.
we add to call CAcloseSslConnectionAll method in IP adapter changed logic.

Change-Id: I3a53852ea3a0ee92a1a75f18e7f0cfd7dc39284c
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15821
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Joonghwan Lee <jh05.lee@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/connectivity/src/ip_adapter/caipadapter.c

index ba23056..9fdec6f 100644 (file)
@@ -170,6 +170,15 @@ void CAIPAdapterHandler(CATransportAdapter_t adapter, CANetworkStatus_t status)
     {
         OIC_LOG(ERROR, TAG, "g_networkChangeCallback is NULL");
     }
+
+    if (CA_INTERFACE_DOWN == status)
+    {
+        OIC_LOG(DEBUG, TAG, "Network status for IP is down");
+#ifdef __WITH_DTLS__
+        OIC_LOG(DEBUG, TAG, "close all ssl session");
+        CAcloseSslConnectionAll();
+#endif
+    }
 }
 
 static void CAUpdateStoredIPAddressInfo(CANetworkStatus_t status)