Skip to content
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

Closed
wants to merge 3 commits into from
Closed

IPv6Only #13

wants to merge 3 commits into from

Conversation

kazu-yamamoto
Copy link
Collaborator

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.

The default value of ipv6_v6only on Linux and Mac is 0.
That for BSD is 1.
@tibbe
Copy link
Member

tibbe commented Jul 14, 2011

@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

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?

Copy link
Collaborator Author

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...

Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Member

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.

@kazu-yamamoto
Copy link
Collaborator Author

What is the status of this pull request?

@tibbe
Copy link
Member

tibbe commented Aug 3, 2011

I left a comment regarding getting the setSocketOption call guarded by an #ifdef which I believe wasn't addressed.

@kazu-yamamoto
Copy link
Collaborator Author

I close this and send another pull request to fix this problem.

@nomeata
Copy link

nomeata commented Sep 20, 2011

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?

@kazu-yamamoto
Copy link
Collaborator Author

What is your problem?

@nomeata
Copy link

nomeata commented Sep 21, 2011

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants