diff --git a/core/src/bootstrap/lwm2m_bootstrap_server.c b/core/src/bootstrap/lwm2m_bootstrap_server.c index bd8d51c..528a19f 100644 --- a/core/src/bootstrap/lwm2m_bootstrap_server.c +++ b/core/src/bootstrap/lwm2m_bootstrap_server.c @@ -38,6 +38,7 @@ #include #include #include +#include #include "awa_bootstrapd_cmdline.h" #include "lwm2m_object_store.h" @@ -191,6 +192,8 @@ static int Bootstrap_Start(Options * options) ipAddress[NI_MAXHOST - 1] = '\0'; // Defensive } + srandom((int)time(NULL)*getpid()); + CoapInfo * coap = coap_Init(ipAddress, options->CoapPort, options->Secure, (options->Verbose) ? DebugLevel_Debug : DebugLevel_Info); if (coap == NULL) { diff --git a/core/src/client/lwm2m_client.c b/core/src/client/lwm2m_client.c index d20f276..5a8aa8a 100644 --- a/core/src/client/lwm2m_client.c +++ b/core/src/client/lwm2m_client.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "awa_clientd_cmdline.h" #include "objdefs.h" @@ -221,6 +222,8 @@ static int Lwm2mClient_Start(Options * options) Lwm2mCore_SetDefaultContentType(options->DefaultContentType); + srandom((int)time(NULL)*getpid()); + CoapInfo * coap = coap_Init((options->AddressFamily == AF_INET) ? "0.0.0.0" : "::", options->CoapPort, false /* not a server */, (options->Verbose) ? DebugLevel_Debug : DebugLevel_Info); if (coap == NULL) { diff --git a/core/src/server/lwm2m_server.c b/core/src/server/lwm2m_server.c index 30f7520..5d98ff9 100644 --- a/core/src/server/lwm2m_server.c +++ b/core/src/server/lwm2m_server.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "awa_serverd_cmdline.h" #include "objdefs.h" @@ -198,6 +199,8 @@ static int Lwm2mServer_Start(Options * options) ipAddress[NI_MAXHOST - 1] = '\0'; // Defensive } + srandom((int)time(NULL)*getpid()); + CoapInfo * coap = coap_Init(ipAddress, options->CoapPort, options->Secure, (options->Verbose) ? DebugLevel_Debug : DebugLevel_Info); if (coap == NULL) {