Correct one more default route save/restore defect

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2011-04-15 07:09:34 -07:00
parent 0b18c37a91
commit d42a65fd11
2 changed files with 14 additions and 4 deletions

View File

@ -567,9 +567,14 @@ restore_default_route() # $1 = USE_DEFAULT_RT
if [ $result = 1 ]; then
#
# We added a default route with metric 0 but there wasn't one previously
# We didn't restore a default route with metric 0
#
qt -4 ip route del default metric 0 && progress_message "Default route with metric 0 deleted"
if $IP -4 -o route ls 2> /dev/null | fgrep default | fgrep -qv metric; then
#
# But we added a default route with metric 0
#
qt $IP -4 route del default metric 0 && progress_message "Default route with metric 0 deleted"
fi
fi
rm -f ${VARDIR}/default_route

View File

@ -555,9 +555,14 @@ restore_default_route() # $1 = USE_DEFAULT_RT
if [ $result = 1 ]; then
#
# We added a default route with metric 0 but there wasn't one previously
# We didn't restore a default route with metric 0
#
qt -6 ip route del default metric 0 && progress_message "Default route with metric 0 deleted"
if $IP -6 -o route ls 2> /dev/null | fgrep default | fgrep -qv metric; then
#
# But we added a default route with metric 0
#
qt $IP -6 route del default metric 0 && progress_message "Default route with metric 0 deleted"
fi
fi
rm -f ${VARDIR}/default_route