|
|
@ -208,12 +208,17 @@ def _ports_match(protocol, module_min, module_max, rule_min, rule_max):
|
|
|
|
if module_max and int(module_max) == -1:
|
|
|
|
if module_max and int(module_max) == -1:
|
|
|
|
module_max = None
|
|
|
|
module_max = None
|
|
|
|
|
|
|
|
|
|
|
|
# Check if user is supplying None values for full TCP/UDP port range.
|
|
|
|
# Check if the user is supplying -1 or None values for full TPC/UDP port range.
|
|
|
|
if protocol in ['tcp', 'udp'] and module_min is None and module_max is None:
|
|
|
|
if protocol in ['tcp', 'udp'] or protocol is None:
|
|
|
|
if (rule_min and int(rule_min) == 1
|
|
|
|
if module_min and module_max and int(module_min) == int(module_max) == -1:
|
|
|
|
and rule_max and int(rule_max) == 65535):
|
|
|
|
module_min = None
|
|
|
|
# (None, None) == (1, 65535)
|
|
|
|
module_max = None
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
if ((module_min is None and module_max is None) and
|
|
|
|
|
|
|
|
(rule_min and int(rule_min) == 1 and
|
|
|
|
|
|
|
|
rule_max and int(rule_max) == 65535)):
|
|
|
|
|
|
|
|
# (None, None) == (1, 65535)
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
# Sanity check to make sure we don't have type comparison issues.
|
|
|
|
# Sanity check to make sure we don't have type comparison issues.
|
|
|
|
if module_min:
|
|
|
|
if module_min:
|
|
|
|