]> git.proxmox.com Git - pve-firewall.git/blobdiff - src/PVE/Firewall.pm
allow to use utf8 encoded comments
[pve-firewall.git] / src / PVE / Firewall.pm
index 44068249992b7a78b9b6acbb31ce3d1a0ea575f9..1946381cb88faa39b64727cea68da3e89be9e127 100644 (file)
@@ -13,6 +13,7 @@ use File::Path;
 use IO::File;
 use Net::IP;
 use PVE::Tools qw(run_command lock_file);
+use Encode;
 
 # dynamically include PVE::QemuServer and PVE::OpenVZ 
 # to avoid dependency problems
@@ -1213,7 +1214,7 @@ sub parse_fw_rule {
     my ($type, $action, $iface, $source, $dest, $proto, $dport, $sport);
 
     # we can add single line comments to the end of the rule
-    my $comment = $1 if $line =~ s/#\s*(.*?)\s*$//;
+    my $comment = decode('utf8', $1) if $line =~ s/#\s*(.*?)\s*$//;
 
     # we can disable a rule when prefixed with '|'
     my $disable = 1 if  $line =~ s/^\|//;
@@ -1827,9 +1828,6 @@ sub compile {
        }
     }
 
-    # fixme: this is an optimization? if so, we should also drop INVALID packages?
-    ruleset_insertrule($ruleset, "PVEFW-FORWARD", "-m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT");
-
     # fixme: what log level should we use here?
     my $loglevel = get_option_log_level($hostfw_options, "log_level_out");