diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/socket/socket.c | 3 |
2 files changed, 8 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Thu Jan 8 00:26:35 2009 Tanaka Akira <akr@fsij.org> + + * ext/socket/socket.c (addrinfo_getnameinfo): use NI_DGRAM if socktype + is SOCK_DGRAM. + Thu Jan 8 00:16:22 2009 Tanaka Akira <akr@fsij.org> * ext/socket/socket.c (host_str): add flags_ptr argument to specify diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 49bd7503c5..aa959aa4e9 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -4491,6 +4491,9 @@ addrinfo_getnameinfo(int argc, VALUE *argv, VALUE self) flags = NIL_P(vflags) ? 0 : NUM2INT(vflags); + if (rai->socktype == SOCK_DGRAM) + flags |= NI_DGRAM; + error = getnameinfo((struct sockaddr *)&rai->addr, rai->sockaddr_len, hbuf, sizeof(hbuf), pbuf, sizeof(pbuf), flags); |