fix #2193: arpfilter: CT: remove mask from net ip cidr.
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 2 May 2019 05:04:16 +0000 (07:04 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 7 May 2019 09:40:35 +0000 (09:40 +0000)
We need to send to ebtables an host address without prefix or with
/32 prefix.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
src/PVE/Firewall.pm

index 806fd4b..e679127 100644 (file)
@@ -3782,7 +3782,10 @@ sub compile_ebtables_filter {
                        push(@$arpfilter, $ip);
                    }
                }
-               push(@$arpfilter, $net->{ip}) if $net->{ip} && $vmfw_conf->{options}->{ipfilter};
+               if($net->{ip} && $vmfw_conf->{options}->{ipfilter}) {
+                   $net->{ip} =~ s|/(\d+)$||;
+                   push(@$arpfilter, $net->{ip});
+               }
                generate_tap_layer2filter($ruleset, $iface, $macaddr, $vmfw_conf, $vmid, $arpfilter);
            }
        };