Convert port number to an integer

This commit is contained in:
TheKysek 2016-08-29 11:34:28 +02:00
parent 8ea3992ae5
commit e90bf9df54

View File

@ -113,7 +113,7 @@ class NetAddrNoPrefix(object):
b += b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF' + host
except socket.error:
b += socket.inet_pton(socket.AF_INET6, self.host)
b += struct.pack('>H', self.port)
b += struct.pack('>H', int(self.port))
return b
@classmethod