Skip to content

Commit d7a6bba

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#22103: test: Fix IPv6 check on BSD systems
2be3572 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 2be3572 - nice improvement. I checked that with this change ipv6 related tests in `feature_proxy.py` are being run. theStack: ACK 2be3572 Tree-SHA512: 8417c2d3cf71050529f3fa409a03872040fe5d249eae4172f276e62156e505a20d375b963712a186c9ad7967d8a497b5900d327c74a9693f68c33063871d4691
2 parents 619e930 + 2be3572 commit d7a6bba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/functional/test_framework/netutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def test_ipv6_local():
151151
have_ipv6 = True
152152
try:
153153
s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
154-
s.connect(('::1', 0))
154+
s.connect(('::1', 1))
155155
except socket.error:
156156
have_ipv6 = False
157157
return have_ipv6

0 commit comments

Comments
 (0)