Commit beb68055 authored by Pekka Pessi's avatar Pekka Pessi

Disabled listen-on-v6 in sresolv/run_test_sresolv.

darcs-hash:20051101161216-65a35-686c17beabdc828561bdde082fadb89513675c32.gz
parent 959255ea
......@@ -43,6 +43,9 @@ export PATH
port=$((($$ % $((65536 - 1024))) + 1024))
ipv6='sysctl net.ipv6.conf.default.mtu >& /dev/null'
# Bind not working with IPv6 on RHEL 4:
# client.c:1325: unexpected error: failed to get request's destination: failure
ipv6=false
# Try to find a free port
if netstat --ip >/dev/null 2>&1 ; then
......@@ -55,14 +58,22 @@ if netstat --ip >/dev/null 2>&1 ; then
done
fi
listen4="listen-on port $port { 127.0.0.1; };"
ns="127.0.0.1"
if eval $ipv6 ; then
if eval $ipv6 &&
ns=$(ip addr ls | awk '
/^[0-9]:/ { up = ($3 ~ /UP/) && ($3 !~ /LOOPBACK/); }
up && $1 ~ /inet6/ { sub(/\/.*$/, "", $2); print $2; exit 0; }')
then
listen6="listen-on-v6 port $port { any; };"
ns="::1"
else
ns="127.0.0.1"
listen4="listen-on port $port { 127.0.0.1; };"
fi
#
# We set up a DNS server at $ns
#
cat > resolv.conf <<EOF
# Zeroconf subnet, reserved range - no-one should answer this
nameserver 169.254.0.2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment