]> git.proxmox.com Git - pve-firewall.git/blobdiff - src/PVE/FirewallSimulator.pm
fwtester.pl: add warnings to trace
[pve-firewall.git] / src / PVE / FirewallSimulator.pm
index 22ddee47c95c1d3463931dd75ea16bd37b41a882..b522776df8f3b3b1299b5e751b4170ebd842a754 100644 (file)
@@ -37,6 +37,14 @@ sub add_trace {
     }
 }
 
+$SIG{'__WARN__'} = sub {
+    my $err = $@;
+    my $t = $_[0];
+    chomp $t;
+    add_trace("$t\n");
+    $@ = $err;
+};
+
 sub nf_dev_match {
     my ($devre, $dev) = @_;
 
@@ -111,7 +119,7 @@ sub rule_match {
            next;
        }
 
-       if ($rule =~ s/^-p (tcp|udp)\s*//) {
+       if ($rule =~ s/^-p (tcp|udp|igmp|icmp)\s*//) {
            die "missing proto" if !$pkg->{proto};
            return undef if $pkg->{proto} ne $1; # no match
            next;