]> git.proxmox.com Git - pve-firewall.git/commitdiff
fix #2004: do not allow backwards ranges
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 30 Nov 2018 15:31:41 +0000 (16:31 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 3 Dec 2018 13:11:08 +0000 (14:11 +0100)
ranges like 10:5 are allowed by us, but iptables throws an error
that is only visible in the syslog and the firewall rules do not
get updated

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/Firewall.pm

index 035dc7e7a96d1a248997246da8618bb6a649ff1a..db1eae36655f8522dd8c8d9d3b7f043d0fd30e52 100644 (file)
@@ -1054,6 +1054,7 @@ sub parse_port_name_number_or_range {
            my ($port1, $port2) = ($1, $2);
            die "invalid port '$port1'\n" if $port1 > 65535;
            die "invalid port '$port2'\n" if $port2 > 65535;
+           die "backwards range '$port1:$port2' not allowed, did you mean '$port2:$port1'?\n" if $port1 > $port2;
        } elsif ($item =~ m/^([0-9]+)$/) {
            $count += 1;
            my $port = $1;