#!/bin/sh
PREFIX="2001:2:"
: ${IFACE:=lo0}
: ${CTRLPORT:=6666}
RT_NUMFIBS=`sysctl -n net.fibs`
PEERADDR="2001:2:ff00::1"
OURADDR="2001:2:ff00::2"
OURLINKLOCAL=""
PEERLINKLOCAL=""
set -e
case "${DEBUG}" in
42) set -x ;;
esac
delay()
{
touch /tmp/foo || true
stat /tmp/foo > /dev/null 2>&1 || true
}
check_rc()
{
local _rc _exp _testno _testname _msg _r
_rc=$1
_exp=$2
_testno=$3
_testname="$4"
_msg="$5"
_r="not ok"
if test ${_rc} -eq ${_exp}; then
_r="ok"
fi
echo "${_r} ${_testno} ${_testname} # ${_msg} ${_rc}"
}
print_debug()
{
local _msg
_msg="$*"
case ${DEBUG} in
''|0) ;;
*) echo "DEBUG: ${_msg}" >&2 ;;
esac
}
die()
{
local _msg
_msg="$*"
echo "ERROR: ${_msg}" >&2
exit 1
}
wait_remote_ready()
{
local _greeting _keyword _fibs _linklocal i
print_debug "Setting up interface ${IFACE}"
ifconfig ${IFACE} inet6 ${OURADDR}/64 -alias > /dev/null 2>&1 || true
delay
ifconfig ${IFACE} inet6 ${OURADDR}/64 alias up
i=0
while test ${i} -lt ${RT_NUMFIBS}; do
ifconfig ${IFACE} inet6 2001:2:${i}::2/64 -alias \
> /dev/null 2>&1 || true
delay
i=$((i + 1))
done
OURLINKLOCAL=`ifconfig ${IFACE} | awk '/inet6 fe80:/ { print $2 }'`
print_debug "Waiting 4 seconds for things to settle"
sleep 4
_greeting=`echo "SETUP ${RT_NUMFIBS} ${OURLINKLOCAL}" | \
nc -6 -l ${CTRLPORT}`
read _keyword _fibs _linklocal <<EOI
${_greeting}
EOI
print_debug "_keyword=${_keyword}"
print_debug "_fibs=${_fibs}"
print_debug "_linklocal=${_linklocal}"
case ${_keyword} in
SETUP) ;;
*) die "Got invalid keyword in greeting: ${_greeting}"
;;
esac
if test ${_fibs} -ne ${RT_NUMFIBS}; then
die "Number of FIBs not matching ours (${RT_NUMFIBS}) in" \
"greeting: ${_greeting}"
fi
PEERLINKLOCAL=${_linklocal}
print_debug "Successfully received greeting. Peer at ${PEERLINKLOCAL}"
}
cleanup()
{
print_debug "Removing address from interface ${IFACE}"
ifconfig ${IFACE} inet6 ${OURADDR}/64 -alias
delay
}
testtx_icmp6_connected()
{
local _opts
_opts=""
case ${DEBUG} in
''|0) ;;
42) _opts="-d -d" ;;
*) _opts="-d" ;;
esac
print_debug "./reflect -p ${CTRLPORT} -T TCP6 " \
"-t testtx_icmp6_connected ${_opts}"
./reflect -p ${CTRLPORT} -T TCP6 -t testtx_icmp6_connected ${_opts}
print_debug "reflect terminated without error."
}
testtx_tcp6_connected()
{
local _opts
_opts=""
case ${DEBUG} in
''|0) ;;
42) _opts="-d -d" ;;
*) _opts="-d" ;;
esac
print_debug "./reflect -p ${CTRLPORT} -T TCP6 " \
"-t testtx_tcp6_connected ${_opts}"
./reflect -p ${CTRLPORT} -T TCP6 -t testtx_tcp6_connected ${_opts}
print_debug "reflect terminated without error."
}
testtx_udp6_connected()
{
local _opts
_opts=""
case ${DEBUG} in
''|0) ;;
42) _opts="-d -d" ;;
*) _opts="-d" ;;
esac
print_debug "./reflect -p ${CTRLPORT} -T UDP6 " \
"-t testtx_udp6_connected ${_opts}"
./reflect -p ${CTRLPORT} -T UDP6 -t testtx_udp6_connected ${_opts}
print_debug "reflect terminated without error."
}
testtx_icmp6_connected_blackhole()
{
local _opts fib
_opts=""
case ${DEBUG} in
''|0) ;;
42) _opts="-d -d" ;;
*) _opts="-d" ;;
esac
fib=0
while test ${fib} -lt ${RT_NUMFIBS}; do
print_debug "./reflect -p ${CTRLPORT} -T TCP6 " \
"-t testtx_icmp6_connected_blackhole${fib} ${_opts}"
./reflect -p ${CTRLPORT} -T TCP6 \
-t testtx_icmp6_connected_blackhole${fib} ${_opts}
print_debug "reflect terminated without error."
fib=$((fib + 1))
done
}
testtx_tcp6_connected_blackhole()
{
local _opts fib
_opts=""
case ${DEBUG} in
''|0) ;;
42) _opts="-d -d" ;;
*) _opts="-d" ;;
esac
fib=0
while test ${fib} -lt ${RT_NUMFIBS}; do
print_debug "./reflect -p ${CTRLPORT} -T TCP6 " \
"-t testtx_tcp6_connected_blackhole${fib} ${_opts}"
./reflect -p ${CTRLPORT} -T TCP6 \
-t testtx_tcp6_connected_blackhole${fib} ${_opts}
print_debug "reflect terminated without error."
fib=$((fib + 1))
done
}
testtx_udp6_connected_blackhole()
{
local _opts fib
_opts=""
case ${DEBUG} in
''|0) ;;
42) _opts="-d -d" ;;
*) _opts="-d" ;;
esac
fib=0
while test ${fib} -lt ${RT_NUMFIBS}; do
print_debug "./reflect -p ${CTRLPORT} -T UDP6 " \
"-t testtx_udp6_connected_blackhole${fib} ${_opts}"
./reflect -p ${CTRLPORT} -T UDP6 \
-t testtx_udp6_connected_blackhole${fib} ${_opts}
print_debug "reflect terminated without error."
fib=$((fib + 1))
done
}
testtx_ulp6_connected_transfernets()
{
local _opts fib _n _o
_n="$1"
_o="$2"
_opts=""
case ${DEBUG} in
''|0) ;;
42) _opts="-d -d" ;;
*) _opts="-d" ;;
esac
fib=0
while test ${fib} -lt ${RT_NUMFIBS}; do
setfib -F${fib} \
ifconfig ${IFACE} inet6 2001:2:${fib}::2/64 alias
fib=$((fib + 1))
done
fib=0
while test ${fib} -lt ${RT_NUMFIBS}; do
print_debug "./reflect -p ${CTRLPORT} -T ${_o} -t ${_n}${fib} ${_opts}"
./reflect -p ${CTRLPORT} -T ${_o} -t ${_n}${fib} ${_opts}
print_debug "reflect terminated without error."
fib=$((fib + 1))
done
fib=0
while test ${fib} -lt ${RT_NUMFIBS}; do
setfib -F${fib} \
ifconfig ${IFACE} inet6 2001:2:${fib}::2/64 -alias
delay
fib=$((fib + 1))
done
}
testtx_icmp6_connected_transfernets()
{
testtx_ulp6_connected_transfernets \
"testtx_icmp6_connected_transfernets" "TCP6"
}
testtx_tcp6_connected_transfernets()
{
testtx_ulp6_connected_transfernets \
"testtx_tcp6_connected_transfernets" "TCP6"
}
testtx_udp6_connected_transfernets()
{
testtx_ulp6_connected_transfernets \
"testtx_udp6_connected_transfernets" "UDP6"
}
testtx_icmp6_connected_ifconfig_transfernets()
{
testtx_ulp6_connected_transfernets \
"testtx_icmp6_connected_ifconfig_transfernets" "TCP6"
}
testtx_tcp6_connected_ifconfig_transfernets()
{
testtx_ulp6_connected_transfernets \
"testtx_tcp6_connected_ifconfig_transfernets" "TCP6"
}
testtx_udp6_connected_ifconfig_transfernets()
{
testtx_ulp6_connected_transfernets \
"testtx_udp6_connected_ifconfig_transfernets" "UDP6"
}
testtx_ulp6_gateway()
{
local _opts _n _o
_n="$1"
_o="$2"
ifconfig lo0 inet6 2001:2:ff01::2 -alias > /dev/null 2>&1 || true
delay
ifconfig lo0 inet6 2001:2:ff01::2 alias
_opts=""
case ${DEBUG} in
''|0) ;;
42) _opts="-d -d" ;;
*) _opts="-d" ;;
esac
print_debug "./reflect -p ${CTRLPORT} -T ${_o} " \
"-t ${_n} ${_opts} -A 2001:2:ff01::2"
./reflect -p ${CTRLPORT} -T ${_o} \
-t ${_n} ${_opts} -A 2001:2:ff01::2
print_debug "reflect terminated without error."
ifconfig lo0 inet6 2001:2:ff01::2 -alias
delay
}
testtx_icmp6_gateway()
{
testtx_ulp6_gateway "testtx_icmp6_gateway" "TCP6"
}
testtx_tcp6_gateway()
{
testtx_ulp6_gateway "testtx_tcp6_gateway" "TCP6"
}
testtx_udp6_gateway()
{
testtx_ulp6_gateway "testtx_udp6_gateway" "UDP6"
}
testtx_ulp6_transfernets_gateways()
{
local _opts fib _n _o
_n="$1"
_o="$2"
_opts=""
case ${DEBUG} in
''|0) ;;
42) _opts="-d -d" ;;
*) _opts="-d" ;;
esac
fib=0
while test ${fib} -lt ${RT_NUMFIBS}; do
setfib -F${fib} \
ifconfig ${IFACE} inet6 2001:2:${fib}::2/64 alias
fib=$((fib + 1))
done
ifconfig lo0 inet6 2001:2:ff01::2 -alias > /dev/null 2>&1 || true
delay
ifconfig lo0 inet6 2001:2:ff01::2 alias
print_debug "./reflect -p ${CTRLPORT} -T ${_o} " \
"-t ${_n} ${_opts} -A 2001:2:ff01::2"
./reflect -p ${CTRLPORT} -T ${_o} \
-t ${_n} ${_opts} -A 2001:2:ff01::2
print_debug "reflect terminated without error."
fib=0
while test ${fib} -lt ${RT_NUMFIBS}; do
setfib -F${fib} \
ifconfig ${IFACE} inet6 2001:2:${fib}::2/64 -alias
delay
fib=$((fib + 1))
done
ifconfig lo0 inet6 2001:2:ff01::2 -alias
}
testtx_icmp6_transfernets_gateways()
{
testtx_ulp6_transfernets_gateways \
"testtx_icmp6_transfernets_gateways" "TCP6"
}
testtx_tcp6_transfernets_gateways()
{
testtx_ulp6_transfernets_gateways \
"testtx_tcp6_transfernets_gateways" "TCP6"
}
testtx_udp6_transfernets_gateways()
{
testtx_ulp6_transfernets_gateways \
"testtx_udp6_transfernets_gateways" "UDP6"
}
testtx_ulp6_transfernets_gateway()
{
local _opts fib _n _o
_n="$1"
_o="$2"
_opts=""
case ${DEBUG} in
''|0) ;;
42) _opts="-d -d" ;;
*) _opts="-d" ;;
esac
fib=0
while test ${fib} -lt ${RT_NUMFIBS}; do
setfib -F${fib} \
ifconfig ${IFACE} inet6 2001:2:${fib}::2/64 alias
fib=$((fib + 1))
done
ifconfig lo0 inet6 2001:2:ff01::2 -alias > /dev/null 2>&1 || true
delay
ifconfig lo0 inet6 2001:2:ff01::2 alias
fib=0
while test ${fib} -lt ${RT_NUMFIBS}; do
print_debug "./reflect -p ${CTRLPORT} -T ${_o} " \
"-t ${_n}${fib} ${_opts} -A 2001:2:ff01::2"
./reflect -p ${CTRLPORT} -T ${_o} \
-t ${_n}${fib} ${_opts} -A 2001:2:ff01::2
print_debug "reflect terminated without error."
fib=$((fib + 1))
done
fib=0
while test ${fib} -lt ${RT_NUMFIBS}; do
setfib -F${fib} \
ifconfig ${IFACE} inet6 2001:2:${fib}::2/64 -alias
delay
fib=$((fib + 1))
done
ifconfig lo0 inet6 2001:2:ff01::2 -alias
}
testtx_icmp6_transfernets_gateway()
{
testtx_ulp6_transfernets_gateway \
"testtx_icmp6_transfernets_gateway" "TCP6"
}
testtx_tcp6_transfernets_gateway()
{
testtx_ulp6_transfernets_gateway \
"testtx_tcp6_transfernets_gateway" "TCP6"
}
testtx_udp6_transfernets_gateway()
{
testtx_ulp6_transfernets_gateway \
"testtx_udp6_transfernets_gateway" "UDP6"
}
textrx_ipfw_setup()
{
local _fib _transfer i _p _o
_fib=$1
_transfer=$2
ipfw add 100 setfib ${_fib} ipv6-icmp \
from ${PEERADDR} to ${OURADDR} \
via ${IFACE} in > /dev/null 2>&1
ipfw add 100 setfib ${_fib} ipv6-icmp \
from ${PEERLINKLOCAL%\%*} to ${OURLINKLOCAL%\%*} \
via ${IFACE} in > /dev/null 2>&1
ipfw add 200 setfib ${_fib} ip6 from ${PEERADDR} to ${OURADDR} \
dst-port ${CTRLPORT} via ${IFACE} in > /dev/null 2>&1
_p="${PEERADDR}"
_o="${OURADDR}"
i=0
while test ${i} -lt ${RT_NUMFIBS}; do
case ${_transfer} in
1) PEERADDR=2001:2:${i}::1
OURADDR=2001:2:${i}::2
;;
esac
if test ${_instances} -gt 1 -o ${_transfer} -eq 1; then
ipfw add 400 setfib ${_fib} ipv6-icmp \
from ${PEERADDR} to ${OURADDR} \
icmp6types 128 \
via ${IFACE} in > /dev/null 2>&1
fi
case ${i} in
${_fib})
ipfw add 400 setfib ${_fib} ip6 \
from ${PEERADDR} to ${OURADDR} \
dst-port $((CTRLPORT + 1000 + i)) \
via ${IFACE} in > /dev/null 2>&1
ipfw add 400 setfib ${_fib} ip6 \
from ${PEERLINKLOCAL%\%*} to ${OURLINKLOCAL%\%*} \
dst-port $((CTRLPORT + 1000 + i)) \
via ${IFACE} in > /dev/null 2>&1
if test ${_instances} -le 1 -o ${_transfer} -ne 1; then
ipfw add 400 setfib ${_fib} ipv6-icmp \
from ${PEERADDR} to ${OURADDR} \
icmp6types 128 \
via ${IFACE} in > /dev/null 2>&1
fi
;;
esac
i=$((i + 1))
done
PEERADDR="${_p}"
OURADDR="${_o}"
case ${DEBUG} in
''|0) ;;
*) ipfw show ;;
esac
}
textrx_ifconfig_setup()
{
local _fib
_fib=$1
ifconfig ${IFACE} fib ${_fib} > /dev/null 2>&1
}
textrx_ipfw_cleanup()
{
local i
case ${DEBUG} in
''|0) ;;
*) ipfw show ;;
esac
ipfw delete 100 > /dev/null 2>&1 || true
ipfw delete 200 > /dev/null 2>&1 || true
ipfw delete 400 > /dev/null 2>&1 || true
i=0
while test ${i} -lt ${RT_NUMFIBS}; do
ipfw delete $((1000 + i)) > /dev/null 2>&1 || true
i=$((i + 1))
done
}
textrx_ifconfig_cleanup()
{
ifconfig ${IFACE} fib 0 > /dev/null 2>&1
}
textrx_count_setup()
{
local i
i=0
while test ${i} -lt ${RT_NUMFIBS}; do
ipfw add $((500 + i)) count ipv6-icmp from any to any \
icmp6types 129 fib ${i} via ${IFACE} out > /dev/null 2>&1
ipfw add $((500 + i)) count tcp from any to any \
fib ${i} via ${IFACE} out > /dev/null 2>&1
ipfw add $((500 + i)) count udp from any to any \
fib ${i} via ${IFACE} out > /dev/null 2>&1
i=$((i + 1))
done
}
textrx_count_results()
{
local _fib _o i _rstr _c _req _p _opts
_fib=$1
_o="$2"
case ${DEBUG} in
''|0) ;;
*) ipfw show ;;
esac
_rstr=""
i=0
while test ${i} -lt ${RT_NUMFIBS}; do
case "${_o}" in
"-i") _c=`ipfw show $((500 + i)) | awk '/ ipv6-icmp / { print $2 }'` ;;
"-u") _c=`ipfw show $((500 + i)) | awk '/ udp / { print $2 }'` ;;
*) _c=`ipfw show $((500 + i)) | awk '/ tcp / { print $2 }'` ;;
esac
_rstr="${_rstr}${i} ${_c},"
ipfw delete $((500 + i)) > /dev/null 2>&1 || true
i=$((i + 1))
done
_req=`echo "RESULT ${_rstr}" | nc -V ${_fib} -6 -l ${CTRLPORT}`
print_debug "$? -- ${_req} -- RESULT ${_rstr}"
}
testrx_remove_connected()
{
local _fib _transfer i j _prefix
_fib=$1
_transfer=$2
if test ${_transfer} -eq 1; then
i=0
while test ${i} -lt ${RT_NUMFIBS}; do
j=0
while test ${j} -lt ${RT_NUMFIBS}; do
_prefix="2001:2:${j}::"
case ${j} in
${_fib});;
*) print_debug "setfib -F${i} route delete" \
"-inet6 -net ${_prefix}"
setfib -F${i} route delete -inet6 -net \
${_prefix} > /dev/null 2>&1
;;
esac
j=$((j + 1))
done
i=$((i + 1))
done
else
_prefix=${OURADDR%2}
i=0
while test ${i} -lt ${RT_NUMFIBS}; do
case ${i} in
${_fib});;
*) print_debug "setfib -F${i} route delete" \
"-inet6 -net ${_prefix}"
setfib -F${i} route delete -inet6 -net \
${_prefix} > /dev/null 2>&1
;;
esac
i=$((i + 1))
done
fi
}
testrx_cleanup_connected()
{
local _fib _transfer i _prefix
_fib=$1
_transfer=$2
if test ${_transfer} -eq 1; then
i=0
while test ${i} -lt ${RT_NUMFIBS}; do
setfib -F${i} \
ifconfig ${IFACE} inet6 2001:2:${i}::2/64 -alias \
> /dev/null 2>&1
delay
i=$((i + 1))
done
else
ifconfig ${IFACE} inet6 ${OURADDR}/64 -alias || true
delay
ifconfig ${IFACE} inet6 ${OURADDR}/64 alias up
fi
}
testrx_setup_transfer_networks()
{
local i
i=0
while test ${i} -lt ${RT_NUMFIBS}; do
ifconfig ${IFACE} inet6 2001:2:${i}::2/64 -alias \
> /dev/null 2>&1 || true
delay
ifconfig ${IFACE} inet6 2001:2:${i}::2/64 alias
i=$((i + 1))
done
}
testrx_run_one()
{
local _fib _txt _opts
_fib=$1
_txt="$2"
_opts="$3"
case ${USE_SOSETFIB} in
0) print_debug "setfib -F${_fib} ./reflect -p ${CTRLPORT}" \
"-t ${_txt} ${_opts}"
setfib -F${_fib} ./reflect -p ${CTRLPORT} -t ${_txt} ${_opts}
;;
1) print_debug "./reflect -F${_fib} -p ${CTRLPORT} -t ${_txt}" \
"${_opts}"
./reflect -F${_fib} -p ${CTRLPORT} -t ${_txt} ${_opts}
;;
*) die "Invalid value for USE_SOSETFIB: ${USE_SOSETFIB}" ;;
esac
print_debug "reflect '${_txt}' terminated without error."
}
testrx_run_multiple()
{
local _fib _txt _opts i _jobs _p _w
_fib=$1
_txt="$2"
_opts="$3"
i=0
_jobs=""
while test ${i} -lt ${RT_NUMFIBS}; do
case ${USE_SOSETFIB} in
0) print_debug "setfib -F${i} ./reflect" \
"-p $((CTRLPORT + 1000 + i))" \
"-t ${_txt} ${_opts} -N -f ${i} &"
setfib -F${i} ./reflect -p $((CTRLPORT + 1000 + i)) \
-t ${_txt} ${_opts} -N -f ${i} &
;;
1) print_debug "./reflect -F ${i}" \
"-p $((CTRLPORT + 1000 + i))" \
"-t ${_txt} ${_opts} -N -f ${i} &"
./reflect -F ${i} -p $((CTRLPORT + 1000 + i)) \
-t ${_txt} ${_opts} -N -f ${i} &
;;
*) die "Invalid value for USE_SOSETFIB: ${USE_SOSETFIB}" ;;
esac
_p=$!
_jobs="${_jobs}${_p} "
case ${i} in
${_fib}) _w=${_p} ;;
esac
i=$((i + 1))
done
testrx_run_one ${_fib} "${_txt}" "${_opts}"
print_debug "KILL ${_jobs}"
for i in ${_jobs}; do
kill ${i} || true
done
print_debug "reflects for '${_txt}' terminated without error."
}
testrx_run_test()
{
local _n _t _fib _o _txt i _f _instance _destructive _transfer
_n="$1"
_t="$2"
_fib=$3
_o="$4"
_instances=$5
_destructive=$6
_transfer=$7
: ${_destructive:=0}
_opts=""
case ${DEBUG} in
''|0) ;;
42) _opts="-d -d" ;;
*) _opts="-d" ;;
esac
case "${_o}" in
-i) _opts="${_opts} -T TCP6" ;;
-u) _opts="${_opts} -T UDP6" ;;
*) _opts="${_opts} -T TCP6" ;;
esac
case ${USE_SOSETFIB} in
0) _f="setfib" ;;
1) _f="so_setfib" ;;
*) die "Unexpected value for SO_SETFIB: ${SO_SETFIB}" ;;
esac
_txt="${_n}_${_f}_${_t}_${_fib}_${_instances}_${_destructive}_${_transfer}"
case ${_transfer} in
1) testrx_setup_transfer_networks ;;
esac
case "${_t}" in
ipfw) textrx_ipfw_setup ${_fib} ${_transfer} ${_instances} ;;
ifconfig) textrx_ifconfig_setup ${_fib} ;;
*) die "Invalid type in ${_txt}" ;;
esac
case ${_destructive} in
1) testrx_remove_connected ${_fib} ${_transfer} ;;
esac
textrx_count_setup
testrx_run_multiple ${_fib} "${_txt}" "${_opts}" ${_transfer}
textrx_count_results ${_fib} "${_o}"
if test ${_destructive} -eq 1 -o ${_transfer} -eq 1; then
testrx_cleanup_connected ${_fib} ${_transfer}
fi
case "${_t}" in
ipfw) textrx_ipfw_cleanup ;;
ifconfig) textrx_ifconfig_cleanup ;;
*) die "Invalid type in ${_txt}" ;;
esac
}
testrx_main()
{
local _n _o s t fib _instances _destructive
_n="$1"
_o="$2"
_instances=$3
: ${_instances:=1}
print_debug "${_n}"
for _transfer in 1 0; do
for _destructive in 0 1; do
for t in ipfw ifconfig; do
print_debug "${_n}_${t}"
fib=0
while test ${fib} -lt ${RT_NUMFIBS}; do
print_debug "${_n}_${t}_${fib}" \
"${_instances} ${_destructive}" \
"${_transfer}"
testrx_run_test "${_n}" "${t}" ${fib} \
"${_o}" ${_instances} \
${_destructive} ${_transfer}
fib=$((fib + 1))
done
done
done
done
}
testrx_icmp6_same_addr_one_fib_a_time()
{
testrx_main "testrx_icmp6_same_addr_one_fib_a_time" "-i"
}
testrx_tcp6_same_addr_one_fib_a_time()
{
testrx_main "testrx_tcp6_same_addr_one_fib_a_time" ""
}
testrx_udp6_same_addr_one_fib_a_time()
{
testrx_main "testrx_udp6_same_addr_one_fib_a_time" "-u"
}
testrx_tcp6_same_addr_all_fibs_a_time()
{
testrx_main "testrx_tcp6_same_addr_all_fibs_a_time" "" ${RT_NUMFIBS}
}
testrx_udp6_same_addr_all_fibs_a_time()
{
testrx_main "testrx_udp6_same_addr_all_fibs_a_time" "-u" ${RT_NUMFIBS}
}
if test `sysctl -n security.jail.jailed` -eq 0; then
kldload ipfw > /dev/null 2>&1 || kldstat -v | grep -q ipfw
fi
ipfw -f flush > /dev/null 2>&1 || die "please load ipfw in base system"
ipfw add 65000 permit ip from any to any > /dev/null 2>&1
killall reflect || true
wait_remote_ready
for uso in 0 1; do
test ${uso} -ne 0 || testtx_icmp6_connected
testtx_tcp6_connected
testtx_udp6_connected
test ${uso} -ne 0 || testtx_icmp6_connected_blackhole
testtx_tcp6_connected_blackhole
testtx_udp6_connected_blackhole
test ${uso} -ne 0 || testtx_icmp6_connected_transfernets
testtx_tcp6_connected_transfernets
testtx_udp6_connected_transfernets
test ${uso} -ne 0 || testtx_icmp6_connected_ifconfig_transfernets
testtx_tcp6_connected_ifconfig_transfernets
testtx_udp6_connected_ifconfig_transfernets
test ${uso} -ne 0 || testtx_icmp6_gateway
testtx_tcp6_gateway
testtx_udp6_gateway
test ${uso} -ne 0 || testtx_icmp6_transfernets_gateways
testtx_tcp6_transfernets_gateways
testtx_udp6_transfernets_gateways
test ${uso} -ne 0 || testtx_icmp6_transfernets_gateway
testtx_tcp6_transfernets_gateway
testtx_udp6_transfernets_gateway
done
ipfw -f flush > /dev/null 2>&1
ipfw add 65000 permit ip from any to any > /dev/null 2>&1
for uso in 0 1; do
USE_SOSETFIB=${uso}
test ${uso} -ne 0 || testrx_icmp6_same_addr_one_fib_a_time
testrx_tcp6_same_addr_one_fib_a_time
testrx_udp6_same_addr_one_fib_a_time
testrx_tcp6_same_addr_all_fibs_a_time
testrx_udp6_same_addr_all_fibs_a_time
done
cleanup