Skip to content

Commit

Permalink
Merge pull request #565 from qstokkink/fix_tracker_discovery
Browse files Browse the repository at this point in the history
Fix tracker for DiscoveryCommunity intro request
  • Loading branch information
qstokkink committed Apr 19, 2018
2 parents 4c940d8 + b5372c6 commit 2a018b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions conversion.py
Expand Up @@ -1322,10 +1322,17 @@ class TrackerBinaryConversion(BinaryConversion):

TUNNEL_MIDS = ['d241f50f97288ed6b6f5e2fcca6a9021150743b0'.decode('hex'),
'fffcf46ce30b3df5f921ded33436e854bbae6fc4'.decode('hex')]
DISCOVERY_MIDS = ['7e313685c1912a141279f8248fc8db5899c5df5a'.decode('hex')]

def _decode_introduction_request(self, placeholder, offset, data):
if self.community.cid in self.TUNNEL_MIDS:
offset += 1
elif self.community.cid in self.DISCOVERY_MIDS:
offset += 21 if data[offset] == 'Y' else 0
try:
return super(TrackerBinaryConversion, self)._decode_introduction_request(placeholder, offset, data)
except:
offset -= 21

return super(TrackerBinaryConversion, self)._decode_introduction_request(placeholder, offset, data)

Expand Down

0 comments on commit 2a018b6

Please sign in to comment.