This repository has been archived by the owner. It is now read-only.

Use socket specs for getaddrinfo() in sock_connect() #365

Merged
merged 1 commit into from Jun 28, 2016

Conversation

Projects
None yet
3 participants
@Martiusweb
Member

Martiusweb commented Jun 27, 2016

In BaseSelectorEventLoop.sock_connect(), an address is resolved if needed, but
getaddrinfo() isn't called with the socket's parameters (family, proto, etc).
If the resolved address mismatch the socket type, the connection fails.

For instance, if getaddrinfo() returns an IPv6 (AF_INET6) resolution and the
socket is of family AF_INET, sock_connect() eventually raises a TypeError.

This PR is a follow-up to #357.

Use socket specs for getaddrinfo() in sock_connect()
In BaseSelectorEventLoop.sock_connect(), an address is resolved if needed, but
getaddrinfo() isn't called with the socket's parameters (family, proto, etc).
If the resolved address mismatch the socket type, the connection fails.

For instance, if getaddrinfo() returns an IPv6 (AF_INET6) resolution and the
socket is an AF_INET, sock_connect() eventually raises a TypeError.
@ajdavis

This comment has been minimized.

ajdavis commented Jun 27, 2016

LGTM, thanks.

@1st1

This comment has been minimized.

Member

1st1 commented Jun 27, 2016

LGTM

@1st1 1st1 merged commit c288d5b into python:master Jun 28, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@1st1

This comment has been minimized.

Member

1st1 commented Jun 28, 2016

Thanks a lot!

@Martiusweb Martiusweb deleted the Martiusweb:sock_connect_ipv6 branch Jun 28, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.