Avoid compiling traffic shaping twice

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@4781 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-11-01 18:57:35 +00:00
parent bbb71aacc5
commit 5551fe4589
3 changed files with 40 additions and 5 deletions

View File

@ -9,6 +9,8 @@ Changes in 3.3.4
4) Turn off POLICY_MATCH if no IPSEC. 4) Turn off POLICY_MATCH if no IPSEC.
5) Only compile traffic shaping once.
Changes in 3.3.4 Changes in 3.3.4
1) Make exclusion work with "show zones" 1) Make exclusion work with "show zones"

View File

@ -937,8 +937,11 @@ setup_tc1() {
save_progress_message "Setting up Traffic Control..." save_progress_message "Setting up Traffic Control..."
append_file $TC_SCRIPT append_file $TC_SCRIPT
elif [ "$TC_ENABLED" = Internal ]; then elif [ "$TC_ENABLED" = Internal ]; then
strip_file_and_lib_load tcdevices tc if [ -n "$LIB_tc_LOADED" ]; then
strip_file_and_lib_load tcclasses tc && setup_traffic_shaping save_command
save_command setup_traffic_shaping
save_command
fi
fi fi
} }
@ -1047,8 +1050,10 @@ __EOF__
if [ -n "$TC_SCRIPT" ]; then if [ -n "$TC_SCRIPT" ]; then
save_progress_message "Refreshing Traffic Shaping" save_progress_message "Refreshing Traffic Shaping"
run_user_exit $TC_SCRIPT run_user_exit $TC_SCRIPT
elif [ "$TC_ENABLED" = Internal ]; then elif [ "$TC_ENABLED" = Internal -a -n "$LIB_tc_LOADED" ]; then
[ -n "$LIB_tc_LOADED" ] && setup_traffic_shaping save_command
save_command setup_traffic_shaping
save_command
fi fi
} }
@ -1089,6 +1094,7 @@ compile_refresh_firewall()
INDENT="" INDENT=""
save_command "}" save_command "}"
save_command
} }
@ -4540,7 +4546,7 @@ activate_rules()
fi fi
done done
# #
# Now add the jumps to the interface (first) chains from FORWARD, INPUT and POSTROUTING # Now add the jumps to the interface chains from FORWARD, INPUT, OUTPUT and POSTROUTING
# #
for interface in $ALL_INTERFACES ; do for interface in $ALL_INTERFACES ; do
run_iptables -A FORWARD -i $interface -j $(forward_chain $interface) run_iptables -A FORWARD -i $interface -j $(forward_chain $interface)
@ -5227,6 +5233,16 @@ __EOF__
[ -d \${VARDIR} ] || mkdir -p \${VARDIR} [ -d \${VARDIR} ] || mkdir -p \${VARDIR}
} }
__EOF__
if [ "$TC_ENABLED" = Internal ]; then
strip_file_and_lib_load tcdevices tc
strip_file_and_lib_load tcclasses tc
[ -n "$LIB_tc_LOADED" ] && setup_traffic_shaping
fi
cat >&3 << __EOF__
# #
# Start/Restart/Reload the firewall # Start/Restart/Reload the firewall

View File

@ -291,6 +291,17 @@ setup_traffic_shaping()
validate_tcdevices_file validate_tcdevices_file
validate_tcclasses_file validate_tcclasses_file
cat >&3 << __EOF__
#
# Set up Traffic Shaping
#
setup_traffic_shaping()
{
__EOF__
INDENT=" "
if [ -s $TMP_DIR/tcdevices ]; then if [ -s $TMP_DIR/tcdevices ]; then
save_progress_message "Setting up Traffic Control..." save_progress_message "Setting up Traffic Control..."
progress_message2 "$DOING $devfile..." progress_message2 "$DOING $devfile..."
@ -330,5 +341,11 @@ setup_traffic_shaping()
done < $TMP_DIR/tcclasses done < $TMP_DIR/tcclasses
[ -n "$last_device" ] && finish_device [ -n "$last_device" ] && finish_device
fi fi
INDENT=
save_command "}"
save_command
} }