From 1edb4822bee2ccda6e6ca9b510205fbb2454c513 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Mon, 26 Jul 2021 23:18:14 +0300 Subject: [PATCH] Change supscriptions in protocol.checkIPv4Address() to have bytes in python3 --- src/protocol.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/protocol.py b/src/protocol.py index b0a438cf..d80bd7bf 100644 --- a/src/protocol.py +++ b/src/protocol.py @@ -173,13 +173,13 @@ def checkIPv4Address(host, hostStandardFormat, private=False): Returns hostStandardFormat if it is an IPv4 address, otherwise returns False """ - if host[0] == b'\x7F': # 127/8 + if host[0:1] == b'\x7F': # 127/8 if not private: logger.debug( 'Ignoring IP address in loopback range: %s', hostStandardFormat) return hostStandardFormat if private else False - if host[0] == b'\x0A': # 10/8 + if host[0:1] == b'\x0A': # 10/8 if not private: logger.debug( 'Ignoring IP address in private range: %s', hostStandardFormat)