Support IPv6 whitelists and blacklists (#30)

Support ipv6
main
Steve Hay 2 years ago committed by GitHub
parent c99ecfb29f
commit 2695fd4eba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,7 +15,7 @@ def verify_whitelist(ip):
# Check blacklist # Check blacklist
for network in config.blacklist_cidr: for network in config.blacklist_cidr:
if address in ipaddress.IPv4Network(network): if address in ipaddress.ip_network(network):
return False return False
if not config.use_whitelist: if not config.use_whitelist:
@ -23,7 +23,7 @@ def verify_whitelist(ip):
# Check whitelist # Check whitelist
for network in config.whitelist_cidr: for network in config.whitelist_cidr:
if address in ipaddress.IPv4Network(network): if address in ipaddress.ip_network(network):
return True return True
return False return False

Loading…
Cancel
Save