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
IPv6Only #13
IPv6Only #13
Conversation
The default value of ipv6_v6only on Linux and Mac is 0. That for BSD is 1.
@bos would you mind taking a look? |
@@ -240,6 +240,7 @@ listen' serv = do | |||
(sClose) | |||
(\sock -> do | |||
setSocketOption sock ReuseAddr 1 | |||
setSocketOption sock IPv6Only 0 |
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.
Shouldn't this be guarded by #ifdef IPV6_V6ONLY?
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.
The IPV6_V6ONLY macro is not available here unfortunately...
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.
Where is IPV6_V6ONLY
defined? If it's generated by autoconf, couldn't you include the relevant .h
file here? If IPv6Only
is defined conditionally in one module but use unconditionally here, the network package won't build on platforms that don't define 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.
It's defined in winsock2.h
on Windows, which is included by include/HsNet.h
. Since those are C include files, they can't be included straight into Network.hs
because they'll make the build fail.
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.
You can try to rename Network.hs
to Network.hsc
and include include/HsNet.h
. Or perhaps it's enough to add the CPP
LANGUAGE
pragma.
What is the status of this pull request? |
I left a comment regarding getting the |
I close this and send another pull request to fix this problem. |
This also affects yesod on Debian, where net.ipv6.bindv6only is set to one by default. What pull request has replaced this one, and/or has this been fixed? |
What is your problem? |
I was under the impression that this pull request is not merged, and could not find another, sorry if this is wrong. Anyways, something is still amiss, but Michael is looking into it (https://github.com/snoyberg/warp/issues/9). |
Linux and BSD have a different default value for the IPV6_V6ONLY socket option. This patch sets it to false so that a listening socket can accept both IPv4 and IPv6 by default. Also, this patch discloses the IPV6_V6ONLY option to Haskell users so that they can change it.