- Fix for iter_dec_attempts that could cause a hang, part of
capsforid and qname minimisation, depending on the settings.
- Fix uninitialized memory passed in padding bytes of cmsg to sendmsg.
+ - Fix stat_values test to work with dig that enables DNS cookies.
17 August 2023: Wouter
- Merge PR #762: Downstream DNS Server Cookies a la RFC7873 and
DEBUG=0
+if dig -h 2>&1 | grep "cookie" >/dev/null; then
+ nocookie="+nocookie"
+else
+ nocookie=""
+fi
+
# Write stats to $STATS_FILE.
# Call this when you want to get stats from unbound.
get_stats () {
# Bring the downstream DNS Cookies configured Unbound up
kill_pid $UNBOUND_PID # kill current Unbound
+echo ""
+cat unbound.log
+echo ""
$PRE/unbound -d -c ub_downstream_cookies.conf >unbound.log 2>&1 &
UNBOUND_PID=$!
echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
echo
echo "[ Get a DNS Cookie. ]"
-echo "> dig www.local.zone +tcp +ednsopt=10:0102030405060708"
-dig @127.0.0.1 -p $UNBOUND_PORT +tcp +ednsopt=10:0102030405060708 +retry=0 +time=1 www.local.zone. | tee outfile
+echo "> dig www.local.zone +tcp $nocookie +ednsopt=10:0102030405060708"
+dig @127.0.0.1 -p $UNBOUND_PORT +tcp $nocookie +ednsopt=10:0102030405060708 +retry=0 +time=1 www.local.zone. | tee outfile
echo "> check answer"
if grep "192.0.2.1" outfile; then
echo "OK"
echo
echo "[ Present the valid DNS Cookie. ]"
-echo "> dig www.local.zone +ednsopt=10:valid_cookie"
-dig @127.0.0.1 -p $UNBOUND_PORT +ednsopt=10:$valid_cookie +retry=0 +time=1 www.local.zone. | tee outfile
+echo "> dig www.local.zone $nocookie +ednsopt=10:valid_cookie"
+dig @127.0.0.1 -p $UNBOUND_PORT $nocookie +ednsopt=10:$valid_cookie +retry=0 +time=1 www.local.zone. | tee outfile
echo "> check answer"
if grep "192.0.2.1" outfile; then
echo "OK"
echo
echo "[ Present an invalid DNS Cookie. ]"
-echo "> dig www.local.zone +ednsopt=10:invalid_cookie"
-dig @127.0.0.1 -p $UNBOUND_PORT +ednsopt=10:$invalid_cookie +retry=0 +time=1 www.local.zone. | tee outfile
+echo "> dig www.local.zone $nocookie +ednsopt=10:invalid_cookie"
+dig @127.0.0.1 -p $UNBOUND_PORT $nocookie +ednsopt=10:$invalid_cookie +retry=0 +time=1 www.local.zone. | tee outfile
echo "> check answer"
if grep "192.0.2.1" outfile; then
end 1
echo
echo "[ Present no DNS Cookie. ]"
echo "> dig www.local.zone +ignore"
-dig @127.0.0.1 -p $UNBOUND_PORT +ignore +retry=0 +time=1 www.local.zone. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT +ignore $nocookie +retry=0 +time=1 www.local.zone. | tee outfile
echo "> check answer"
if grep "192.0.2.1" outfile; then
end 1
# Bring the cachedb configured Unbound up
kill_pid $UNBOUND_PID # kill current Unbound
+echo ""
+cat unbound.log
+echo ""
$PRE/unbound -d -c ub_cachedb.conf >unbound.log 2>&1 &
UNBOUND_PID=$!
echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test