summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-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 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);