-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
IPv6 server vs. IPv4 client mismatch on FreeBSD #587
Comments
I replaced v6() with v4() and the problem is gone. You should probably make v6()/v4() passed as an argument to "listen". |
On most systems I've tested on this usage of Asio listen allows connections from both v4 and v6. The endpoint will appear as a v6 only one from the point of view of your code. For example, if you ask for the remote address it will be in IPv6 format and in the case of a v4 connection the address listed will be a mapped v4 address ( I'll do some more testing with Asio on freebsd, but in the meantime, if your systems doesn't behave this way you can explicitly listen on v4 via a listen overload already:
|
This mapping might be a linuxism. I think you should just delete the functions that default to IPv6 or IPv4. This should be the decision made on the application level, not on the library level IMO. |
After a bit of research, it looks like this is standard RFC documented behavior for dual stack IPv6 implementations and is controlled by the I'll think a bit about whether it makes sense to have a default address family. Based on the usage that I have seen the vast majority of WebSocket++ library users will want the current default and those that don't do currently have an easy way to specify something else. I also haven't seen many libraries at this level of abstraction that require the user to explicitly specify an address family.
|
I see, I didn't know about IPV6_V6ONLY. Now I found that on FreeBSD there is a relevant sysctl option Of course, once you provided the default functions most users just use them without even being aware of this. But I still think that you shouldn't make websocketpp implicitly depend on The difference between IPv4 and IPv6 is a big deal, apps should be aware which protocol they use. |
- Unbreaks GUI by applying two patches: - Patch in boost headers to prevent EINPROGRESS mishandling zaphoyd/websocketpp#563 - Patch in websocketpp fixing IPv4 vs. IPv6 mismatch zaphoyd/websocketpp#587 - GUI option is made default - Clones icons for the GUI app cadabra2-gui - Adds "USE_TEX=texmf texhash" to allow for unincluded latex macros, and to make tex hash local packages installed by cadabra2 - Verified that cadabra2 GUI now works fine - it is able to run many examples from their website. PR: 213329 Submitted by: Yuri Victorovich <yuri@rawbw.com> (maintainer) git-svn-id: svn+ssh://svn.freebsd.org/ports/head@424395 35697150-7ecd-e111-bb59-0022644237b5
- Unbreaks GUI by applying two patches: - Patch in boost headers to prevent EINPROGRESS mishandling zaphoyd/websocketpp#563 - Patch in websocketpp fixing IPv4 vs. IPv6 mismatch zaphoyd/websocketpp#587 - GUI option is made default - Clones icons for the GUI app cadabra2-gui - Adds "USE_TEX=texmf texhash" to allow for unincluded latex macros, and to make tex hash local packages installed by cadabra2 - Verified that cadabra2 GUI now works fine - it is able to run many examples from their website. PR: 213329 Submitted by: Yuri Victorovich <yuri@rawbw.com> (maintainer)
I am looking at cadabra2 project that uses websocketpp.
On the server these functions call each other:
wserver.listen(0); -> listen(lib::asio::ip::tcp::v6(), port); -> ... -> bind(INET6)
The comment says
The IPv6 protocol with mapped IPv4 for dual stack hosts will be used.
But the actualbind
is only done using IPv6. Then client tries to connect to 127.0.0.1:{same port} and gets 'connection refused'.FreeBSD has dual stack, but this doesn't mean that you can connect from IPv4 to IPv6. How is this supposed to work?
PS: This is separate from the other bug related to cadabra2 on FreeBSD that is about EINPROGRESS mishandling.
The text was updated successfully, but these errors were encountered: