Fixed TestIPv6.v6_calls_v4 in case the system-default IPV6_V6ONLY is 1. #2420
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
TestIPv6.v6_calls_v4
test fails is the system-default value of the IPV6_V6ONLY is 1 (r.g. it is so on FreeBSD, see #2007).Therefore, the required value (0) has to be set on the caller socket explicitly. It can be done with the
SRTO_IPV6ONLY
socket option.To Reproduce
Required OS: Linux.
(Change system-default to 1) sysctl -w net.ipv6.bindv6only=1 (Check the value is set) cat /proc/sys/net/ipv6/bindv6only (Run IPv6 unit tests) ./test-srt --gtest_filter="TestIPv6*"
Result without the fix:
With the PR
Fixes #2007.
Follow-up Thoughts
From the man page:
In the
TestIPv6.v6_calls_v4
unit test the listener is bound to IPv4, and we can't setIPPROTO_IPV6/IPV6_V6ONLY
on an IPv4 UDP socket.Also, SRT would ignore it, see the following condition:
Setting
IPPROTO_IPV6/IPV6_V6ONLY
on the caller socket allows sending to and receiving from an IPv4-mapped IPv6 address.