Skip to content

Commit

Permalink
Workaround for the bootstrap server not being seen as a bootstrap ser…
Browse files Browse the repository at this point in the history
…ver due to faulty address resolution.
  • Loading branch information
mtusnio committed Nov 18, 2016
1 parent c57b5ca commit 17d8926
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/src/client/lwm2m_security_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,19 @@ static LWM2MSecurityInfo * GetSecurityInfoForAddress(Lwm2mContextType * context,
bool Lwm2mCore_ServerIsBootstrap(Lwm2mContextType * context, AddressType * address)
{
bool result = false;

struct ListHead * current;
ListForEach(current, Lwm2mCore_GetSecurityObjectList(context))
{
LWM2MSecurityInfo * securityInfo = ListEntry(current, LWM2MSecurityInfo, list);
Lwm2m_Debug("Address found: %s, is bootstrap: %i\n", Lwm2mCore_DebugPrintAddress(&securityInfo->address),
securityInfo->IsBootstrapServer);
if(securityInfo->AddressResolved == 0)
{
securityInfo->AddressResolved = coap_ResolveAddressByURI(securityInfo->ServerURI, &securityInfo->addre$
}
}

LWM2MSecurityInfo * security = GetSecurityInfoForAddress(context, address);
if (security == NULL)
{
Expand Down

0 comments on commit 17d8926

Please sign in to comment.