diff options
Diffstat (limited to 'sysconfig/network-scripts/ifdown-ipsec')
-rwxr-xr-x | sysconfig/network-scripts/ifdown-ipsec | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/ifdown-ipsec b/sysconfig/network-scripts/ifdown-ipsec index 3b03e277..a960144f 100755 --- a/sysconfig/network-scripts/ifdown-ipsec +++ b/sysconfig/network-scripts/ifdown-ipsec @@ -35,6 +35,10 @@ fi [ -n "$IKE_METHOD" ] && KEYING=automatic [ -z "$KEYING" ] && KEYING=manual +if [ -z "$SRC" ]; then + SRC=`ip -o route get to $DST | sed "s|.*src \([^ ]*\).*|\1|"` +fi + if [ -n "$SRCNET" -o -n "$DSTNET" ]; then MODE=tunnel [ -z "$SRCNET" ] && SRCNET="$SRC/32" @@ -49,10 +53,6 @@ else MODE=host fi -if [ -z "$SRC" ]; then - SRC=`ip -o route get to $DST | sed "s|.*src \([^ ]*\).*|\1|"` -fi - if [ "$KEYING" = "manual" ]; then setkey -c << EOF ${SPI_AH_OUT:+delete $SRC $DST ah $SPI_AH_OUT;} |