diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-01-14 22:13:02 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-01-14 22:13:02 -0200 |
commit | c15a87f7a16ced0c73cc709480cbcab651c78603 (patch) | |
tree | 6ff217852d6a898dfc3ecc945638e53f8fd0d056 /usr/local/sbin/ppp-linkdown | |
parent | b2a0a8e939179e2277450135ecaf78724f406934 (diff) | |
download | pfsense-c15a87f7a16ced0c73cc709480cbcab651c78603.zip pfsense-c15a87f7a16ced0c73cc709480cbcab651c78603.tar.gz |
Avoid duplicating /32 suffix on 3rd ppp-linkdown parameter (local-ip). It should fix #2700
Diffstat (limited to 'usr/local/sbin/ppp-linkdown')
-rwxr-xr-x | usr/local/sbin/ppp-linkdown | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/usr/local/sbin/ppp-linkdown b/usr/local/sbin/ppp-linkdown index 56a96d9..87560f7 100755 --- a/usr/local/sbin/ppp-linkdown +++ b/usr/local/sbin/ppp-linkdown @@ -4,10 +4,16 @@ if [ -f /tmp/$1up ] && [ -f /conf/$1.log ]; then /usr/local/sbin/ppp-log-uptime.sh $seconds $1 & fi if [ "$3" != "" ]; then - echo "Removing states from $3" | logger -t ppp-linkdown - /sbin/pfctl -k 0.0.0.0/0 -k $3/32 - /sbin/pfctl -k $3/32 - pfctl -K $3/32 + if echo "$3" | grep -q '/'; then + LOCAL_IP="${3}" + else + LOCAL_IP="${3}/32" + fi + + echo "Removing states from ${LOCAL_IP}" | logger -t ppp-linkdown + /sbin/pfctl -k 0.0.0.0/0 -k ${LOCAL_IP} + /sbin/pfctl -k ${LOCAL_IP} + pfctl -K ${LOCAL_IP} fi OLD_ROUTER=`/bin/cat /tmp/${1}_router` |