mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 11:13:24 +02:00
Merge branch 'master' into kernel-test
This commit is contained in:
@@ -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 "";
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user