From: jnashok Date: Mon, 4 May 2015 07:17:14 +0000 (+0900) Subject: Fix for DTLS message failure when previous not closed properly X-Git-Tag: 1.2.0+RC1~1736 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce54868f1850d05fe88afbc7adfadf568d466b70;p=platform%2Fupstream%2Fiotivity.git Fix for DTLS message failure when previous not closed properly This fixes JIRA issue IOT-417. When a previous DTLS session was not properly closed, DTLS messaging would fail. This patch ensures that DTLS sessions are properly closed. Change-Id: I0483253cad313c7596ae30d9624db57c072417d8 Signed-off-by: jnashok Reviewed-on: https://gerrit.iotivity.org/gerrit/889 Tested-by: jenkins-iotivity Reviewed-by: Sachin Agrawal --- diff --git a/resource/csdk/connectivity/src/ip_adapter/caipadapter.c b/resource/csdk/connectivity/src/ip_adapter/caipadapter.c index 667f958..faf147a 100644 --- a/resource/csdk/connectivity/src/ip_adapter/caipadapter.c +++ b/resource/csdk/connectivity/src/ip_adapter/caipadapter.c @@ -675,6 +675,10 @@ CAResult_t CAStopIP() { OIC_LOG(DEBUG, IP_ADAPTER_TAG, "IN"); +#ifdef __WITH_DTLS__ + CAAdapterNetDtlsDeInit(); +#endif + // Stop IP network monitor CAIPStopNetworkMonitor(); @@ -695,14 +699,14 @@ void CATerminateIP() { OIC_LOG(DEBUG, IP_ADAPTER_TAG, "IN"); + // Stop IP adapter + CAStopIP(); + #ifdef __WITH_DTLS__ CADTLSSetAdapterCallbacks(NULL, NULL, DTLS_IP); - CAAdapterNetDtlsDeInit(); #endif CAIPSetPacketReceiveCallback(NULL); - // Stop IP adapter - CAStopIP(); // Terminate IP server CAIPTerminateServer();