summaryrefslogtreecommitdiff
path: root/ext/socket/udpsocket.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-13 03:14:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-13 03:14:13 +0000
commit61053459cfa5bf55210c5411652ac039dd07c703 (patch)
treec76ca9b10f1bed48dabc7f2e0eae875a0206519c /ext/socket/udpsocket.c
parent18e4a39c9a95dd5d60978e3e32d782a5cbb98850 (diff)
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
Diffstat (limited to 'ext/socket/udpsocket.c')
-rw-r--r--ext/socket/udpsocket.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/socket/udpsocket.c b/ext/socket/udpsocket.c
index d319302..d55ddfe 100644
--- a/ext/socket/udpsocket.c
+++ b/ext/socket/udpsocket.c
@@ -87,7 +87,7 @@ udp_connect(VALUE sock, VALUE host, VALUE port)
VALUE ret;
GetOpenFile(sock, arg.fptr);
- arg.res = rsock_addrinfo(host, port, SOCK_DGRAM, 0);
+ arg.res = rsock_addrinfo(host, port, rsock_fd_family(arg.fptr->fd), SOCK_DGRAM, 0);
ret = rb_ensure(udp_connect_internal, (VALUE)&arg,
rsock_freeaddrinfo, (VALUE)arg.res);
if (!ret) rsock_sys_fail_host_port("connect(2)", host, port);
@@ -131,7 +131,7 @@ udp_bind(VALUE sock, VALUE host, VALUE port)
VALUE ret;
GetOpenFile(sock, arg.fptr);
- arg.res = rsock_addrinfo(host, port, SOCK_DGRAM, 0);
+ arg.res = rsock_addrinfo(host, port, rsock_fd_family(arg.fptr->fd), SOCK_DGRAM, 0);
ret = rb_ensure(udp_bind_internal, (VALUE)&arg,
rsock_freeaddrinfo, (VALUE)arg.res);
if (!ret) rsock_sys_fail_host_port("bind(2)", host, port);
@@ -207,7 +207,7 @@ udp_send(int argc, VALUE *argv, VALUE sock)
GetOpenFile(sock, arg.fptr);
arg.sarg.fd = arg.fptr->fd;
arg.sarg.flags = NUM2INT(flags);
- arg.res = rsock_addrinfo(host, port, SOCK_DGRAM, 0);
+ arg.res = rsock_addrinfo(host, port, rsock_fd_family(arg.fptr->fd), SOCK_DGRAM, 0);
ret = rb_ensure(udp_send_internal, (VALUE)&arg,
rsock_freeaddrinfo, (VALUE)arg.res);
if (!ret) rsock_sys_fail_host_port("sendto(2)", host, port);