From e75bac46a1077a8e0686e6554b8aaf33acecd3e0 Mon Sep 17 00:00:00 2001 From: teastep Date: Wed, 28 Sep 2005 19:39:47 +0000 Subject: [PATCH] Fix 'refresh' traffic control treatment -- Take 3 git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@2740 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/firewall | 2 +- Shorewall/tcclasses | 52 ++++++++++++++++++++++----------------------- Shorewall/tcstart | 5 ++++- 3 files changed, 31 insertions(+), 28 deletions(-) diff --git a/Shorewall/firewall b/Shorewall/firewall index cdd6fac75..5cc77405e 100755 --- a/Shorewall/firewall +++ b/Shorewall/firewall @@ -3827,7 +3827,7 @@ refresh_tc() { f=$(find_file tcstart) if [ -x $f ]; then - export CONFIG_PATH + export CONFIG_PATH SHOREWALL_DIR eval $f fi diff --git a/Shorewall/tcclasses b/Shorewall/tcclasses index a70a10cec..103d4b4aa 100644 --- a/Shorewall/tcclasses +++ b/Shorewall/tcclasses @@ -4,7 +4,7 @@ # /etc/shorewall/tcclasses # # Define the classes used for traffic shaping in this file. -# +# # A note on the rate/bandwidth definitions used in this file: # # - don't use a space between the integer value and @@ -16,13 +16,13 @@ # mbps Megabytes per second # kbit Kilobits per second # mbit Megabits per second -# bps or a +# bps or a # bare number Bytes per second # # - if you want the values to be calculated for you depending # on the output bandwidth setting defined for an interface # in tcdevices, you can use expressions like the following: -# +# # full/3 causes the bandwidth to be calculated # as 3 of the the full outgoing # speed that is defined. @@ -39,7 +39,7 @@ # an alias (e.g., eth0:0) here; see # http://www.shorewall.net/FAQ.htm#faq18 # -# You man NOT specify wildcards here, e.g. if you +# You may NOT specify wildcards here, e.g. if you # have multiple ppp interfaces, you need to put # them all in here! # @@ -50,7 +50,7 @@ # MARK The mark value which is an integer in the range 1-255. # You define this marks in the tcrules file, marking # the traffic you want to fit in the classes defined -# in here. +# in here. # # You can use the same marks for different Interfaces # @@ -59,11 +59,11 @@ # that first the classes which equal or a lesser priority # value are served. # -# You can use the following +# You can use the following #Use kbit or kbps(for Kilobytes per second) for # speed, and make sure there is NO space between the # number and the unit. -# +# # CEIL The maximum bandwidth this class is allowed to use # when the link is idle. Useful if you have traffic # which can get full speed when more needed services @@ -82,18 +82,18 @@ # are handled before lesser priority onces. # You can just define the mark value here also, if you are # increasing the mark values with lesser priority. -# -# OPTIONS A comma-separated list of options including the +# +# OPTIONS A comma-separated list of options including the # following: -# -# default - this is the default class for that -# interface where all traffic should go, +# +# default - this is the default class for that +# interface where all traffic should go, # that is not classified otherwise. # -# NOTE: defining default for exactly one +# NOTE: defining default for exactly one # class per interface is mandatory! # -# tos- - this lets you define a filter for +# tos- - this lets you define a filter for # the given which lets you # define a value of the Type Of Service # bits in the ip package which causes @@ -103,7 +103,7 @@ # a tos filter for a class all traffic # having that mark will go in it regard- # less of the mark on the package. -# You can use the following +# You can use the following # for this option # # tos-minimize-delay (16) @@ -111,12 +111,12 @@ # tos-maximize-reliability (4) # tos-minimize-cost (2) # tos-normal-service (0) -# -# NOTE: each of this options is only +# +# NOTE: each of this options is only # valid for ONE class per interface. -# +# # tcp-ack - if defined causes an tc filter to -# be created that puts all tcp ack +# be created that puts all tcp ack # packets on that interface that have # an size of <=64 Bytes to go in this # class. This is useful for speeding up @@ -124,15 +124,15 @@ # of the ack packages is limited to 64 # bytes as some applications (p2p for # example) use to make every package an -# ack package which would cause them +# ack package which would cause them # all into here. We want only packages # WITHOUT payload to match, so the size # limit. -# -# NOTE: This option is only valid for +# +# NOTE: This option is only valid for # ONE class per interface. # -# +# # # Example 1: Suppose you are using PPP over Ethernet (DSL) # and ppp0 is the interface for this. The @@ -141,10 +141,10 @@ # interactive traffic (ssh) the second for p2p networking # and the last one the rest. They all have a guaranteed # bandwidth of 100kbit upstream, but 1 and 3 can get -# full speed if link is idle, 2 is limited to 200kbit +# full speed if link is idle, 2 is limited to 200kbit # -# ppp0 1 100kbit full 1 tcp-ack,tos-minimize-delay -# ppp0 2 100kbit 200kbit 2 +# ppp0 1 100kbit full 1 tcp-ack,tos-minimize-delay +# ppp0 2 100kbit 200kbit 2 # ppp0 3 full/3 full/2 3 default # ################################################################################ diff --git a/Shorewall/tcstart b/Shorewall/tcstart index fc09010ad..9ed8849a4 100755 --- a/Shorewall/tcstart +++ b/Shorewall/tcstart @@ -7,12 +7,15 @@ created_tmp_dir= if [ "$SHOREWALL_LIBRARY" != Loaded ]; then - SHOREWALL_DIR=. SHARED_DIR=/usr/share/shorewall FUNCTIONS=$SHARED_DIR/functions + CONFIG_DIR=/etc/shorewall . $FUNCTIONS + PARAMS=$(find_file params) + [ -f $PARAMS ] && . $PARAMS + ensure_and_save_command() { if ! eval $* ; then