|
|
@ -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
|
|
|
|