File: Fix-test-failure-on-ipv6-only-build-daemons.patch

package info (click to toggle)
gvm-libs 22.29.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,828 kB
  • sloc: ansic: 36,798; makefile: 26
file content (29 lines) | stat: -rw-r--r-- 1,014 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Sophie Brun <sophie@kali.org>
Date: Mon, 21 Dec 2020 15:14:14 +0100
Subject: Fix test failure on IPv6-only build daemons

Do not run the assertion if the IPv4 connection attempt fails
for some reason, like the unavailablity of IPv4 networking on some
IPv6-only build daemons.

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=976844
---
 boreas/util_tests.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/boreas/util_tests.c b/boreas/util_tests.c
index 5a6bff7..6750e2b 100644
--- a/boreas/util_tests.c
+++ b/boreas/util_tests.c
@@ -161,8 +161,9 @@ Ensure (util, get_source_addr_v4)
   /* Destination is example.com. */
   src.s_addr = INADDR_ANY;
   dst.s_addr = inet_addr ("93.184.216.34");
-  get_source_addr_v4 (&udpv4soc, &dst, &src);
-  assert_that (src.s_addr, is_not_equal_to (INADDR_ANY));
+  if (get_source_addr_v4 (&udpv4soc, &dst, &src) == 0) {
+    assert_that (src.s_addr, is_not_equal_to (INADDR_ANY));
+  }
 
   /* Close socket. */
   close (udpv4soc);