From: Sophie Brun 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 b099896..be834c2 100644 --- a/boreas/util_tests.c +++ b/boreas/util_tests.c @@ -162,8 +162,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);