Skip to content
This repository was archived by the owner on Apr 24, 2019. It is now read-only.

Commit 377280a

Browse files
Yogesh PandeYogesh Pande
authored andcommitted
Fix for IOTCLT-961
This commit fixes issue of mapping of IP addresses for CoAP library is done. The problem was hidden till now, because IP addresses of Bootstrap and mDS were quite different and client was accidently only comparing first 4 characters of the address hence it was identifying them as two different servers. But now the IP addresses are similar to last 2 bytes hence the first 4 byte check always pass even though the IP addresses are different IP Address of Bootstrap is 159.122.226.36 IP Address of mDS is 159.122.226.33 On comparing the first 4 characters now, the CoAP library assumes the requests are still coming for Bootstrap sequence. This commit fixes this issue.
1 parent 5fb49d2 commit 377280a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source/m2minterfaceimpl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ void M2MInterfaceImpl::state_bootstrap_address_resolved( EventData *data)
603603
}
604604
address.port = event->_port;
605605
address.addr_ptr = (uint8_t*)event->_address->_address;
606+
address.addr_len = event->_address->_length;
606607
_connection_handler->start_listening_for_data();
607608

608609
// Include domain id to be part of endpoint name
@@ -819,6 +820,7 @@ void M2MInterfaceImpl::state_coap_data_received( EventData *data)
819820
}
820821
address.port = event->_address->_port;
821822
address.addr_ptr = (uint8_t*)event->_address->_address;
823+
address.addr_len = event->_address->_length;
822824

823825
// Process received data
824826
internal_event(STATE_PROCESSING_COAP_DATA);

0 commit comments

Comments
 (0)