]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test dig with a IPv4 source address and a IPv4+IPv6 server
authorAram Sargsyan <aram@isc.org>
Fri, 31 Oct 2025 16:34:47 +0000 (16:34 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Mon, 3 Nov 2025 19:37:09 +0000 (19:37 +0000)
Check that dig doesn't exit with an assertion failure when a IPv4
source address is defined after defining a server address which has
both IPv4 and IPv6 addresses (in this case, @localhost).

bin/tests/system/digdelv/tests.sh

index 4f97c62106be2f3ca8ab144b7b7a1cb08c092e55..27706388aa347d76121a2eb5803952a1f31a5dc3 100644 (file)
@@ -1442,6 +1442,17 @@ if [ -x "$DIG" ]; then
   grep -E "DS.* [0-9]+ [12] \[omitted]" dig.out.ds.test$n >/dev/null || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status + ret))
+
+  # See GL#5609
+  n=$((n + 1))
+  echo_i "check dig with a IPv4 source address and a server with both IPv4 and IPv6 addresses doesn't crash ($n)"
+  ret=0
+  dig_with_opts @localhost example -b 10.53.0.1 >dig.out.test$n 2>&1 || ret=1
+  # We only care about an assertion failure, otherwise reset 'ret' to 0, because
+  # @localhost is't really expected to have an answer for our query.
+  grep -F "core dumped" dig.out.test$n >/dev/null || ret=0
+  if [ $ret -ne 0 ]; then echo_i "failed"; fi
+  status=$((status + ret))
 else
   echo_i "$DIG is needed, so skipping these dig tests"
 fi