]> git.proxmox.com Git - pve-firewall.git/commitdiff
implement option tcpflags for host firewall
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 20 Mar 2014 06:42:56 +0000 (07:42 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 20 Mar 2014 06:42:56 +0000 (07:42 +0100)
But we only add the check for incoming packets, assuming that the
host itself never generates invalid tcp flags.

src/PVE/Firewall.pm

index 31c2f6e9285bcd82d8282aff0ea91436373de6b6..a929b54ac755b1d0c356c46282867a7c7d2dc3af 100644 (file)
@@ -1125,6 +1125,10 @@ sub enable_host_firewall {
 
     my $loglevel = get_option_log_level($options, "log_level_in");
 
+    if ($options->{tcpflags}) {
+       ruleset_addrule($ruleset, $chain, "-p tcp -j PVEFW-tcpflags");
+    }
+
     ruleset_addrule($ruleset, $chain, "-m conntrack --ctstate INVALID -j DROP");
     ruleset_addrule($ruleset, $chain, "-m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT");
     ruleset_addrule($ruleset, $chain, "-i lo -j ACCEPT");