aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-05-31 07:24:49 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-05-31 07:24:54 +0200
commitd7a6bba94935a26e303e1c99eb2d4cb5f8f97f5b (patch)
tree4b4fb2d622bc5a35fea73e6d404f67453d87dc7d
parent619e930aa1860d92f8eebef3bc1bed8b37c606b8 (diff)
parent2be35725069fd4c589497b93e09e1c6db6946372 (diff)
downloadbitcoin-d7a6bba94935a26e303e1c99eb2d4cb5f8f97f5b.tar.xz
Merge bitcoin/bitcoin#22103: test: Fix IPv6 check on BSD systems
2be35725069fd4c589497b93e09e1c6db6946372 test: Fix IPv6 check on BSD systems (nthumann) Pull request description: I noticed that `test_ipv6_local()` always returns `False` on macOS or FreeBSD, even though IPv6 is working perfectly fine. This causes `test/functional/rpc_bind.py --ipv6` and `test/functional/feature_proxy.py` to skip their run. Apparently, there's a check if the port number is `0` (see [here](https://github.com/freebsd/freebsd-src/blob/64881da478071431a2d9e62613997a5772c56cdf/sys/netinet6/udp6_usrreq.c#L248) or [here](https://github.com/apple/darwin-xnu/blob/8f02f2a044b9bb1ad951987ef5bab20ec9486310/bsd/netinet6/udp6_usrreq.c#L282)), while Linux has no problem with this. This is fixed by specifying any other port number than `0`, e.g. `1`. Still, because of `SOCK_DGRAM`, no actual connection is made. ACKs for top commit: fanquake: ACK 2be35725069fd4c589497b93e09e1c6db6946372 - nice improvement. I checked that with this change ipv6 related tests in `feature_proxy.py` are being run. theStack: ACK 2be35725069fd4c589497b93e09e1c6db6946372 Tree-SHA512: 8417c2d3cf71050529f3fa409a03872040fe5d249eae4172f276e62156e505a20d375b963712a186c9ad7967d8a497b5900d327c74a9693f68c33063871d4691
-rw-r--r--test/functional/test_framework/netutil.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/test_framework/netutil.py b/test/functional/test_framework/netutil.py
index e047e7fa14..5dc723c1d5 100644
--- a/test/functional/test_framework/netutil.py
+++ b/test/functional/test_framework/netutil.py
@@ -151,7 +151,7 @@ def test_ipv6_local():
have_ipv6 = True
try:
s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
- s.connect(('::1', 0))
+ s.connect(('::1', 1))
except socket.error:
have_ipv6 = False
return have_ipv6