[03/17] Revert "Make IMQ Switchable between PREROUTING and POSTROUTING"

Message ID 20191014164627.18516-3-michael.tremer@ipfire.org
State Staged
Commit ec01ebe246072cae77bc53d3c1fc09ad8277a89f
Headers show
Series
  • [01/17] QoS: Do not manually load iptables modules
Related show

Commit Message

Michael Tremer Oct. 14, 2019, 4:46 p.m. UTC
This reverts commit 88b8ffac6b258e7b7687eb26111134bf435e23ca.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 config/qos/makeqosscripts.pl | 28 ++--------------------------
 1 file changed, 2 insertions(+), 26 deletions(-)

Patch

diff --git a/config/qos/makeqosscripts.pl b/config/qos/makeqosscripts.pl
index b2ceb5773..d327ddf1a 100644
--- a/config/qos/makeqosscripts.pl
+++ b/config/qos/makeqosscripts.pl
@@ -75,7 +75,6 @@  $qossettings{'RED_DEV'} = `cat /var/ipfire/red/iface`;
 $qossettings{'IMQ_DEV'} = 'imq0';
 $qossettings{'TOS'} = '';
 $qossettings{'VALID'} = 'yes';
-$qossettings{'IMQ_MODE'} = 'PREROUTING';
 
 &General::readhash("${General::swroot}/qos/settings", \%qossettings);
 
@@ -512,9 +511,6 @@  foreach $subclassentry (sort @subclasses) {
 		print "\ttc filter add dev $qossettings{'DEVICE'} parent 2:0 prio 0 protocol ip handle $qossettings{'SCLASS'} fw flowid 2:$qossettings{'SCLASS'}\n";
 	}
 }
-
-if ( $qossettings{'IMQ_MODE'} eq 'POSTROUTING' )
-{
 print <<END
 
 	### ADD QOS-INC CHAIN TO THE MANGLE TABLE IN IPTABLES
@@ -528,24 +524,6 @@  print <<END
 	### SET TOS
 END
 ;
-}
-else
-{
-print <<END
-
-	### ADD QOS-INC CHAIN TO THE MANGLE TABLE IN IPTABLES
-	iptables -t mangle -N QOS-INC
-	iptables -t mangle -A PREROUTING -i $qossettings{'RED_DEV'} -p ah -j RETURN
-	iptables -t mangle -A PREROUTING -i $qossettings{'RED_DEV'} -p esp -j RETURN
-	iptables -t mangle -A PREROUTING -i $qossettings{'RED_DEV'} -p ip -j RETURN
-	iptables -t mangle -I PREROUTING -i $qossettings{'RED_DEV'} -j QOS-INC
-	iptables -t mangle -A PREROUTING -i $qossettings{'RED_DEV'} -j QOS-TOS
-
-	### SET TOS
-END
-;
-}
-
   	foreach $tosruleentry (sort @tosrules)
   	{
   		@tosruleline = split( /\;/, $tosruleentry );
@@ -710,10 +688,8 @@  print <<END
 	iptables -t mangle --delete POSTROUTING -o $qossettings{'RED_DEV'} -j QOS-TOS >/dev/null 2>&1
 	iptables -t mangle --flush  QOS-OUT >/dev/null 2>&1
 	iptables -t mangle --delete-chain QOS-OUT >/dev/null 2>&1
-	iptables -t mangle --delete FORWARD -i $qossettings{'RED_DEV'} -j QOS-INC >/dev/null 2>&1
-	iptables -t mangle --delete FORWARD -i $qossettings{'RED_DEV'} -j QOS-TOS >/dev/null 2>&1
-	iptables -t mangle --delete PREROUTING -i $qossettings{'RED_DEV'} -j QOS-INC >/dev/null 2>&1
-	iptables -t mangle --delete PREROUTING -i $qossettings{'RED_DEV'} -j QOS-TOS >/dev/null 2>&1
+	iptables -t mangle --delete FORWARD -i $qossettings{'RED_DEV'} -j QOS-INC
+	iptables -t mangle --delete FORWARD -i $qossettings{'RED_DEV'} -j QOS-TOS
 	iptables -t mangle --flush  QOS-INC >/dev/null 2>&1
 	iptables -t mangle --delete-chain QOS-INC >/dev/null 2>&1
 	iptables -t mangle --flush  QOS-TOS >/dev/null 2>&1