aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2003-09-11 16:05:01 +0000
committerBill Nottingham <notting@redhat.com>2003-09-11 16:05:01 +0000
commit0d08190bd1909940678677a0dde00c42761d7f4c (patch)
treeee66b176027bf6f2e10d4b90a1e85026c0e4aa92 /sysconfig/network-scripts
parent0d785aa231bd358ffff1800d2130faa9eb1eb8aa (diff)
downloadinitscripts-0d08190bd1909940678677a0dde00c42761d7f4c.tar
initscripts-0d08190bd1909940678677a0dde00c42761d7f4c.tar.gz
initscripts-0d08190bd1909940678677a0dde00c42761d7f4c.tar.bz2
initscripts-0d08190bd1909940678677a0dde00c42761d7f4c.tar.xz
initscripts-0d08190bd1909940678677a0dde00c42761d7f4c.zip
more ipsec fixes (#104227, <harald@redhat.com>)
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-xsysconfig/network-scripts/ifdown-ipsec17
-rwxr-xr-xsysconfig/network-scripts/ifup-ipsec8
2 files changed, 18 insertions, 7 deletions
diff --git a/sysconfig/network-scripts/ifdown-ipsec b/sysconfig/network-scripts/ifdown-ipsec
index 60480cdb..37e5f76f 100755
--- a/sysconfig/network-scripts/ifdown-ipsec
+++ b/sysconfig/network-scripts/ifdown-ipsec
@@ -47,10 +47,21 @@ delete $DST $SRC esp $SPI_ESP_IN;
EOF
fi
-setkey -c << EOF
-spddelete $SRC $DST any -P out;
-spddelete $DST $SRC any -P in;
+if [ "$MODE" = "host" ]; then
+ setkey -c << EOF
+ spddelete $SRC $DST any -P out;
+ spddelete $DST $SRC any -P in;
EOF
+else
+ [ -z "$SRCNET" ] && SRCNET="$SRC/32"
+ [ -z "$DSTNET" ] && DSTNET="$DST/32"
+
+ /sbin/setkey -c >/dev/null 2>&1 << EOF
+ spddelete $SRCNET $DSTNET any -P out;
+ spddelete $DSTNET $SRCNET any -P in;
+EOF
+fi
+
if [ "$KEYING" = "automatic" ]; then
racoontmp=`mktemp /etc/racoon/racoon.XXXXXX`
diff --git a/sysconfig/network-scripts/ifup-ipsec b/sysconfig/network-scripts/ifup-ipsec
index 5de55bc8..3ea68768 100755
--- a/sysconfig/network-scripts/ifup-ipsec
+++ b/sysconfig/network-scripts/ifup-ipsec
@@ -134,8 +134,8 @@ spdadd $DST $SRC any -P in ipsec
;
EOF
else
- [ -n "$SRCNET" ] && SRCNET="$SRC/32"
- [ -n "$DSTNET" ] && DSTNET="$DST/32"
+ [ -z "$SRCNET" ] && SRCNET="$SRC/32"
+ [ -z "$DSTNET" ] && DSTNET="$DST/32"
/sbin/setkey -c >/dev/null 2>&1 << EOF
delete $SRC $DST ah $SPI_AH_OUT;
@@ -186,8 +186,8 @@ spdadd $DST $SRC any -P in ipsec
;
EOF
else
- [ -n "$SRCNET" ] && SRCNET="$SRC/32"
- [ -n "$DSTNET" ] && DSTNET="$DST/32"
+ [ -z "$SRCNET" ] && SRCNET="$SRC/32"
+ [ -z "$DSTNET" ] && DSTNET="$DST/32"
/sbin/setkey -c >/dev/null 2>&1 << EOF
spddelete $SRCNET $DSTNET any -P out;