X-Git-Url: https://git.proxmox.com/?p=pve-firewall.git;a=blobdiff_plain;f=pvefw;h=4ac96796e7331f32bbd293fafce45692f4f93478;hp=978ffb15cdac07e95364d9c52bd137da2cd682f8;hb=9a4644fa5560e9087b50e5f9c11699590ad8966e;hpb=8cebfa6f274d94b92a34f1cc4dd992a0d751d0df diff --git a/pvefw b/pvefw index 978ffb1..4ac9679 100755 --- a/pvefw +++ b/pvefw @@ -56,7 +56,7 @@ sub parse_fw_rules { my ($action, $iface, $source, $dest, $proto, $dport, $sport) = split(/\s+/, $line); - if (!($action && $iface && $source && $dest)) { + if (!$action) { warn "skip incomplete line\n"; next; } @@ -75,26 +75,26 @@ sub parse_fw_rules { next; } - $iface = undef if $iface eq '-'; + $iface = undef if $iface && $iface eq '-'; if ($iface && $iface !~ m/^(net0|net1|net2|net3|net4|net5)$/) { warn "unknown interface '$iface'\n"; next; } - $proto = undef if $proto eq '-'; + $proto = undef if $proto && $proto eq '-'; if ($proto && $proto !~ m/^(icmp|tcp|udp)$/) { warn "unknown protokol '$proto'\n"; next; } - $source = undef if $source eq '-'; + $source = undef if $source && $source eq '-'; # if ($source !~ m/^(XYZ)$/) { # warn "unknown source '$source'\n"; # next; # } - $dest = undef if $dest eq '-'; + $dest = undef if $dest && $dest eq '-'; # if ($dest !~ m/^XYZ)$/) { # warn "unknown destination '$dest'\n"; # next;