Merge branch 'master' into kernel-test

This commit is contained in:
Arne Fitzenreiter
2014-10-11 09:11:10 +02:00
9 changed files with 4401 additions and 16 deletions

View File

@@ -238,8 +238,8 @@ sub get_interface
if($net eq "$netsettings{'BLUE_NETADDRESS'}/$netsettings{'BLUE_NETMASK'}"){
return "$netsettings{'BLUE_DEV'}";
}
if($net eq "0.0.0.0/0"){
return "$netsettings{'RED_DEV'}";
if($net eq "0.0.0.0/0") {
return &get_external_interface();
}
return "";
}

View File

@@ -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");
}
}

View File

@@ -7,4 +7,5 @@ srv/web/ipfire/cgi-bin/fwhosts.cgi
srv/web/ipfire/cgi-bin/urlfilter.cgi
usr/lib/firewall/firewall-lib.pl
usr/lib/firewall/rules.pl
usr/local/bin/update-lang-cache
var/ipfire/langs