aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sockets.c3
-rw-r--r--sockets.h3
2 files changed, 5 insertions, 1 deletions
diff --git a/sockets.c b/sockets.c
index ef35220..e1f7ad3 100644
--- a/sockets.c
+++ b/sockets.c
@@ -750,6 +750,9 @@ sock_address_list_create( const char* hostname,
else
ai.ai_flags |= AI_CANONNAME;
+ if (flags & SOCKET_LIST_DGRAM)
+ ai.ai_socktype = SOCK_DGRAM;
+
while (1) {
struct addrinfo hints = ai;
diff --git a/sockets.h b/sockets.h
index 785a37e..6ce3041 100644
--- a/sockets.h
+++ b/sockets.h
@@ -258,7 +258,8 @@ int sock_address_get_numeric_info( SockAddress* a,
enum {
SOCKET_LIST_PASSIVE = (1 << 0),
SOCKET_LIST_FORCE_INET = (1 << 1),
- SOCKET_LIST_FORCE_IN6 = (1 << 2)
+ SOCKET_LIST_FORCE_IN6 = (1 << 2),
+ SOCKET_LIST_DGRAM = (1 << 3),
};
/* resolve a host and service/port name into a list of SockAddress objects.