From 9eb6fde7ff0d8c345d370cd96f7ffa17a806de98 Mon Sep 17 00:00:00 2001 From: "bbruns@gmail.com" Date: Sun, 27 Jul 2014 21:46:39 +0000 Subject: [PATCH] fixes --- lib/iptables.inc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/iptables.inc b/lib/iptables.inc index 743f55c..976360d 100644 --- a/lib/iptables.inc +++ b/lib/iptables.inc @@ -172,7 +172,7 @@ function enable_mss_clamp { ${debug} ${DebugColor} "${FUNCNAME}:${DEFAULT_COLOR} loading" if [ -e "${FWCONFIGDIR}/ipv${IPVER}/mss-clamp.conf" ]; then ${debug} ${DebugColor} "${FUNCNAME}:${DEFAULT_COLOR} read ${FWCONFIGDIR}/ipv${IPVER}/mss-clamp.conf successful" - while read -r interface mss type size; do + while read -r interface mss type msssize; do [[ ${interface} = \#* ]] && continue [[ ${interface} = "" ]] && continue [[ -z ${mss} ]] && mss="-" @@ -181,12 +181,13 @@ function enable_mss_clamp { [[ ${type} == "-" ]] && type="${OutFilter}" [[ ${type} == "out" ]] && type="${OutFilter}" [[ ${type} == "fwd" ]] && type="${FwdFilter}" - [[ -z ${size} ]] && size="-" - [[ ${size} == "-" ]] && size="--clamp-mss-to-pmtu" - [[ ${size} != "-" ]] && size="--set-mss ${size}" - ${debug} ${DebugColor} "${FUNCNAME}:${DEFAULT_COLOR} Read: ${interface} ${mss} ${type} ${size}" + [[ -z ${msssize} ]] && msssize="-" + [[ ${msssize} == "-" ]] && msssize="--clamp-mss-to-pmtu" + [[ ${msssize} != "-" ]] && msssize="--set-mss ${msssize}" + ${debug} ${DebugColor} "${FUNCNAME}:${DEFAULT_COLOR} Read: ${interface} ${mss} ${type} ${msssize}" ${VER_IPTABLES} -A ${type} -p tcp --tcp-flags SYN,RST SYN -j TCPMSS \ - ${size} -o ${interface} -m tcpmss --mss ${mss} + -o ${interface} -m tcpmss --mss ${mss} ${msssize} + unset mss msssize interface type done < "${FWCONFIGDIR}/ipv${IPVER}/mss-clamp.conf" ${debug} ${DebugColor} "${FUNCNAME}:${DEFAULT_COLOR} done"