summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/socket/socket.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 460ac8547bc..7fc99b79131 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 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);