]> git.proxmox.com Git - pve-firewall.git/commitdiff
icmp: allow to specify the echo-reply (0) type as integer
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 4 May 2020 12:13:02 +0000 (14:13 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 4 May 2020 12:13:02 +0000 (14:13 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Firewall.pm

index 28dbb194822f49ac9ad461eebca41aef9ea6200b..a6157e343b3992cec41279b806f9a0a6d36e2a19 100644 (file)
@@ -2039,7 +2039,7 @@ sub ipt_rule_to_cmds {
            my $multisport = defined($rule->{sport}) && parse_port_name_number_or_range($rule->{sport}, 0);
 
            my $add_dport = sub {
-               return if !$rule->{dport};
+               return if !defined($rule->{dport});
 
                if ($proto eq 'icmp') {
                    # Note: we use dport to store --icmp-type
@@ -2062,6 +2062,7 @@ sub ipt_rule_to_cmds {
                } elsif ($multidport) {
                    push @match, "--match multiport", "--dports $rule->{dport}";
                } else {
+                   return if !$rule->{dport};
                    push @match, "--dport $rule->{dport}";
                }
            };