summaryrefslogtreecommitdiff
path: root/src/validators/port-multi
diff options
context:
space:
mode:
authorBᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>2022-01-11 20:41:20 +0100
committerBᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>2022-01-11 20:41:20 +0100
commit4793e2fc0baf09c8ef128147106acb8bb69ba02b (patch)
tree69990a98168d9456b4ba21e30a9eb0d2f2bcac19 /src/validators/port-multi
parent24954d47010219d85f11e1f7aae70c91f7ce00b4 (diff)
downloadvyos-1x-4793e2fc0baf09c8ef128147106acb8bb69ba02b.tar.gz
vyos-1x-4793e2fc0baf09c8ef128147106acb8bb69ba02b.zip
firewall: validators: T4174: Correct upper port range boundary
Diffstat (limited to 'src/validators/port-multi')
-rwxr-xr-xsrc/validators/port-multi4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/validators/port-multi b/src/validators/port-multi
index 763d34e57..017ea78fb 100755
--- a/src/validators/port-multi
+++ b/src/validators/port-multi
@@ -24,14 +24,14 @@ if __name__ == '__main__':
for port in ports:
if re.match('^[0-9]{1,5}-[0-9]{1,5}$', port):
port_1, port_2 = port.split('-')
- if int(port_1) not in range(1, 65535) or int(port_2) not in range(1, 65535):
+ if int(port_1) not in range(1, 65536) or int(port_2) not in range(1, 65536):
print(f'Error: {port} is not a valid port range')
sys.exit(1)
if int(port_1) > int(port_2):
print(f'Error: {port} is not a valid port range')
sys.exit(1)
elif port.isnumeric():
- if int(port) not in range(1, 65535):
+ if int(port) not in range(1, 65536):
print(f'Error: {port} is not a valid port')
sys.exit(1)
elif port not in services: