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

Make sure we create correct socket family. #334

Merged
merged 3 commits into from
Apr 18, 2018

Conversation

Lukasa
Copy link
Contributor

@Lukasa Lukasa commented Apr 18, 2018

Motivation:

If a server binds "localhost", and then we try to connect with an
AF_INET socket, then on macOS at least some of the time we will have
a protocol mismatch, as at least some of the time localhost will have
resolved to ::1 before 127.0.0.1.

That's bad.

Modifications:

Create a socket whose address family matches the server's.

Result:

This test will pass more often

Motivation:

If a server binds "localhost", and then we try to connect with an
AF_INET socket, then on macOS at least some of the time we will have
a protocol mismatch, as at least some of the time localhost will have
resolved to ::1 before 127.0.0.1.

That's bad.

Modifications:

Create a socket whose address family matches the server's.

Result:

This test will pass more often
@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Apr 18, 2018
@Lukasa Lukasa requested review from normanmaurer and weissi April 18, 2018 18:34
Copy link
Member

@weissi weissi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha! nice

@weissi
Copy link
Member

weissi commented Apr 18, 2018

@swift-nio-bot test this please

@normanmaurer normanmaurer merged commit 2bce766 into apple:master Apr 18, 2018
@normanmaurer normanmaurer added this to the 1.5.0 milestone Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants