]> git.proxmox.com Git - pve-firewall.git/blobdiff - src/PVE/Firewall.pm
icmp: allow to specify the echo-reply (0) type as integer
[pve-firewall.git] / 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}";
                }
            };