Change supscriptions in protocol.checkIPv4Address()
to have bytes in python3
This commit is contained in:
parent
805e4097e2
commit
1edb4822be
|
@ -173,13 +173,13 @@ def checkIPv4Address(host, hostStandardFormat, private=False):
|
||||||
Returns hostStandardFormat if it is an IPv4 address,
|
Returns hostStandardFormat if it is an IPv4 address,
|
||||||
otherwise returns False
|
otherwise returns False
|
||||||
"""
|
"""
|
||||||
if host[0] == b'\x7F': # 127/8
|
if host[0:1] == b'\x7F': # 127/8
|
||||||
if not private:
|
if not private:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
'Ignoring IP address in loopback range: %s',
|
'Ignoring IP address in loopback range: %s',
|
||||||
hostStandardFormat)
|
hostStandardFormat)
|
||||||
return hostStandardFormat if private else False
|
return hostStandardFormat if private else False
|
||||||
if host[0] == b'\x0A': # 10/8
|
if host[0:1] == b'\x0A': # 10/8
|
||||||
if not private:
|
if not private:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
'Ignoring IP address in private range: %s', hostStandardFormat)
|
'Ignoring IP address in private range: %s', hostStandardFormat)
|
||||||
|
|
Reference in New Issue
Block a user