1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

rsock_addrinfo: specify address family

* ext/socket/rsock_addrinfo (rsock_addrinfo): specify address
  family.  [Fix GH-1052]
* ext/socket/udpsocket.c (udp_connect, udp_bind, udp_send):
  address family by the receiver.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-10-13 03:14:13 +00:00
parent 18e4a39c9a
commit 61053459cf
7 changed files with 41 additions and 14 deletions

View file

@ -50,8 +50,9 @@ tcp_sockaddr(struct sockaddr *addr, socklen_t len)
static VALUE
tcp_s_gethostbyname(VALUE obj, VALUE host)
{
return rsock_make_hostent(host, rsock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME),
tcp_sockaddr);
struct rb_addrinfo *res =
rsock_addrinfo(host, Qnil, AF_UNSPEC, SOCK_STREAM, AI_CANONNAME);
return rsock_make_hostent(host, res, tcp_sockaddr);
}
void