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 <jn.ashok@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/889
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sachin Agrawal <sachin.agrawal@intel.com>
{
OIC_LOG(DEBUG, IP_ADAPTER_TAG, "IN");
+#ifdef __WITH_DTLS__
+ CAAdapterNetDtlsDeInit();
+#endif
+
// Stop IP network monitor
CAIPStopNetworkMonitor();
{
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();