summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-07 15:27:09 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-07 15:27:09 +0000
commit3802c43ea16b6691121f69b4cbe392fc0d42ac34 (patch)
treefc0a62991bca1ad712f20aab806bebf0634834e6 /ext/socket
parent0f94c670f707144b0157227425a650aba3d61ae6 (diff)
* ext/socket/socket.c (addrinfo_getnameinfo): use NI_DGRAM if socktype
is SOCK_DGRAM. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/socket.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 49bd7503c5b..aa959aa4e91 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);