Skip to content

Commit

Permalink
COAP-44. Fix possible mismatch due to different string encoding of IPv6.
Browse files Browse the repository at this point in the history
  • Loading branch information
malishav committed Mar 30, 2019
1 parent d12d3d9 commit 82b0766
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion coap/coap.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def _receive(self,timestamp,sender,rawbytes):
for (k,v) in self.transmitters.items():
# try matching
if (
msgkey[0]==k[0] and
u.ipv6AddrString2Bytes(msgkey[0])==u.ipv6AddrString2Bytes(k[0]) and
msgkey[1]==k[1] and
(
msgkey[2]==k[2] or
Expand Down
2 changes: 1 addition & 1 deletion coap/coapTransmitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def getState(self):
return self.state

def receiveMessage(self, timestamp, srcIp, srcPort, message):
assert srcIp==self.destIp
assert u.ipv6AddrString2Bytes(srcIp)==u.ipv6AddrString2Bytes(self.destIp)
assert srcPort==self.destPort
assert (message['token']==self.token) or (message['messageId']==self.messageId)

Expand Down

0 comments on commit 82b0766

Please sign in to comment.