From b6e4ebe86fd553123f295fec919409b963150544 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Mon, 14 Feb 2022 20:03:04 +0100 Subject: [PATCH] firewall: Drop support for blocking P2P protocols. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The main P2P (peer-to-peer) aera has passed for several year now, so this kind of feature is realy out-dated. The feature only supports a handfull of P2P protocols (mostly unencrypted) for applications, which have been superseeded by various other applications and protocols. So, this fairly is not longer required and safely can be dropped. Signed-off-by: Stefan Schantl Acked-by: Peter Müller Acked-by: Michael Tremer --- config/firewall/rules.pl | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/config/firewall/rules.pl b/config/firewall/rules.pl index c0878059a..25d01e0e3 100644 --- a/config/firewall/rules.pl +++ b/config/firewall/rules.pl @@ -72,12 +72,9 @@ my %locationsettings = ( ); my %loaded_ipset_lists=(); -my @p2ps=(); - my $configfwdfw = "${General::swroot}/firewall/config"; my $configinput = "${General::swroot}/firewall/input"; my $configoutgoing = "${General::swroot}/firewall/outgoing"; -my $p2pfile = "${General::swroot}/firewall/p2protocols"; my $locationfile = "${General::swroot}/firewall/locationblock"; my $configgrp = "${General::swroot}/fwhosts/customgroups"; my $netsettings = "${General::swroot}/ethernet/settings"; @@ -134,9 +131,6 @@ sub main { &buildrules(\%configfwdfw); } - # Load P2P block rules. - &p2pblock(); - # Load Location block rules. &locationblock(); @@ -656,23 +650,6 @@ sub time_convert_to_minutes { return ($hrs * 60) + $min; } -sub p2pblock { - open(FILE, "<$p2pfile") or die "Unable to read $p2pfile"; - my @protocols = (); - foreach my $p2pentry () { - my @p2pline = split(/\;/, $p2pentry); - next unless ($p2pline[2] eq "off"); - - push(@protocols, "--$p2pline[1]"); - } - close(FILE); - - run("$IPTABLES -F P2PBLOCK"); - if (@protocols) { - run("$IPTABLES -A P2PBLOCK -m ipp2p @protocols -j DROP"); - } -} - sub locationblock { # The LOCATIONBLOCK chain now gets flushed by the flush() function.