[pve-devel] applied: [PATCH firewall 3/4] icmp: allow to specify the echo-reply (0) type as integer
Thomas Lamprecht
t.lamprecht at proxmox.com
Mon May 4 14:15:26 CEST 2020
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
src/PVE/Firewall.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/PVE/Firewall.pm b/src/PVE/Firewall.pm
index 28dbb19..a6157e3 100644
--- a/src/PVE/Firewall.pm
+++ b/src/PVE/Firewall.pm
@@ -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}";
}
};
--
2.20.1
More information about the pve-devel
mailing list