]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Merge branch 'next' v2.15-core85
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 16 Oct 2014 09:36:21 +0000 (11:36 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 16 Oct 2014 09:36:21 +0000 (11:36 +0200)
Conflicts:
make.sh

config/firewall/rules.pl
src/initscripts/init.d/dhcrelay [changed mode: 0755->0644]
src/initscripts/init.d/firewall

index 4d703825d170b588fecb61043e424d57904de2ce..75a9357f64bc6047a47f81ad56f9c9e46301489f 100755 (executable)
@@ -554,29 +554,19 @@ sub time_convert_to_minutes {
 }
 
 sub p2pblock {
-       my $search_action;
-       my $target;
-
-       if ($fwdfwsettings{"POLICY"} eq "MODE1") {
-               $search_action = "on";
-               $target = "ACCEPT";
-       } else {
-               $search_action = "off";
-               $target = "DROP";
-       }
-
        open(FILE, "<$p2pfile") or die "Unable to read $p2pfile";
        my @protocols = ();
        foreach my $p2pentry (<FILE>) {
                my @p2pline = split(/\;/, $p2pentry);
-               next unless ($p2pline[2] eq $search_action);
+               next unless ($p2pline[2] eq "off");
 
                push(@protocols, "--$p2pline[1]");
        }
        close(FILE);
 
+       run("$IPTABLES -F P2PBLOCK");
        if (@protocols) {
-               run("$IPTABLES -A FORWARDFW -m ipp2p @protocols -j $target");
+               run("$IPTABLES -A P2PBLOCK -m ipp2p @protocols -j DROP");
        }
 }
 
old mode 100755 (executable)
new mode 100644 (file)
index 66ca432a26d607b1eb8afdcdf17be4c61370dad9..c383652e0b5e89b086caac5a1d745181fb113b6b 100644 (file)
@@ -104,6 +104,12 @@ iptables_init() {
        iptables -t nat -N CUSTOMPOSTROUTING
        iptables -t nat -A POSTROUTING -j CUSTOMPOSTROUTING
 
+       # P2PBLOCK
+       iptables -N P2PBLOCK
+       iptables -A INPUT -j P2PBLOCK
+       iptables -A FORWARD -j P2PBLOCK
+       iptables -A OUTPUT -j P2PBLOCK
+       
        # Guardian (IPS) chains
        iptables -N GUARDIAN
        iptables -A INPUT -j GUARDIAN