-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid dual-stack #516
base: main
Are you sure you want to change the base?
Avoid dual-stack #516
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #516 +/- ##
===========================================
- Coverage 100.00% 99.92% -0.08%
===========================================
Files 25 25
Lines 4999 5124 +125
===========================================
+ Hits 4999 5120 +121
- Misses 0 4 +4 ☔ View full report in Codecov by Sentry. |
Just because OpenBSD doesn't support dual-stack doesn't sound like a reason to disable the feature for all OS's that do. Can we detect the fact dual-stack doesn't work? Or opt in for this behaviour? |
@jlaine well, I can do something like this. |
Any suggestions on how to add OpenBSD to our CI pipeline? |
A few moths ago I did https://github.com/catap/shell whcih can be used as an example to add different system to github actions. |
3aa752d
to
3c4a567
Compare
@jlaine 👋 |
I'd like to share a proof that with this PR both stacke: IPv4 and IPv6 working on my laptop under OpenBSD:
|
@rthalley I'd really hate to introduce code we're not able to test, do you have any suggestions on how to proceed? Do you have any well-established projects in mind which have an example OpenBSD setup in their CI? |
@jlaine, here a way. Some time ago I write an article how to utilize GitHub Actions as a shell on different OS: https://kirill.korins.ky/articles/using-github-actions-as-a-temporary-shell/ which leads to create a demo repository https://github.com/catap/shell which uses https://github.com/vmactions which can be used to extend your CI to some additional OS. |
Looking into this a bit deeper, I don't think we need to inspect the platform at all, there is a https://docs.python.org/3/library/socket.html#socket.has_dualstack_ipv6 This means we can probably get away with mocking this method and don't actually need to run the tests on BSD. Also I suspect OpenBSD is not the only BSD-family OS with this behaviour. This Python bug has some relevant information: |
@jlaine I had ported this spring Scala-Native to different BSD and if I recall right the same behaviour is true for NetBSD. Anyway, as far as I recall FreeBSD supports dual-stack like Linux. But it has much more differences with scoket strucutres length which should be ignored here. |
@jlaine like this I was able to pass almots all unit test on OpenBSD. Anyway, it has one more things: OpenBSD uses LibreSSL which doesn't support ED448, so I need this patch:
and, additionally, it has small differences inside API which I fixed by this patch:
because all chipers are handled via static lookup inside LibreSSL. I plan to ship it as the next PR. |
I was wrong. After switch to
and
|
I like the plan to use socket.has_dualstack_ipv6() as then we can just run the relevant tests both ways in the CI. It's not quite the same as running on the actual OS, but likely good enough. |
Let's keep this PR narrowly focused on the socket stuff please :) |
@@ -23,6 +23,7 @@ async def connect( | |||
token_handler: Optional[QuicTokenHandler] = None, | |||
wait_connected: bool = True, | |||
local_port: int = 0, | |||
dual_stack: bool = socket.has_dualstack_ipv6(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we want to disable dual stack on a system that supports it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To enforce binding to IPv6 only for example. Rigth now it binds to both protocol on Linux, and if you desier to bind only for IPv6 here no way.
OpenBSD doesn't support dual stack, that makes this broken on machine which hasn't got IPv6. Anyway, a machine which has IPv6, still, can't access IPv4 hosts.
@jlaine I had rebased this branch to the last |
@jlaine and ping here as well |
OpenBSD doesn't support dual stack, that makes this broken on machine which hasn't got IPv6.
Anyway, a machine which has IPv6, still, can't access IPv4 hosts.