From 6396641fd56681efcc354e42154db7c6c0b86ddd Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Sat, 15 Jul 2000 12:50:32 +0000 Subject: [PATCH] add new function that takes socktype hint as parameter git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8669 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/getaddrinfo_hostspec.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/roken/getaddrinfo_hostspec.c b/lib/roken/getaddrinfo_hostspec.c index cafd06fcc..67e8da01c 100644 --- a/lib/roken/getaddrinfo_hostspec.c +++ b/lib/roken/getaddrinfo_hostspec.c @@ -41,9 +41,10 @@ RCSID("$Id$"); /* getaddrinfo via string specifying host and port */ int -roken_getaddrinfo_hostspec(const char *hostspec, - int port, - struct addrinfo **ai) +roken_getaddrinfo_hostspec2(const char *hostspec, + int socktype, + int port, + struct addrinfo **ai) { const char *p; char portstr[NI_MAXSERV]; @@ -65,6 +66,8 @@ roken_getaddrinfo_hostspec(const char *hostspec, }; memset(&hints, 0, sizeof(hints)); + + hints.ai_socktype = socktype; for(hstp = hst; hstp->prefix; hstp++) { if(strncmp(hostspec, hstp->prefix, strlen(hstp->prefix)) == 0) { @@ -91,3 +94,11 @@ roken_getaddrinfo_hostspec(const char *hostspec, snprintf (host, sizeof(host), "%.*s", hostspec_len, hostspec); return getaddrinfo (host, portstr, &hints, ai); } + +int +roken_getaddrinfo_hostspec(const char *hostspec, + int port, + struct addrinfo **ai) +{ + return roken_getaddrinfo_hostspec2(hostspec, 0, port, ai); +}