From 999cc34c830a11b124295ee14ecbab69f850354e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 16 Mar 2010 16:15:39 +0100 Subject: [PATCH] rtspconnection: allow for more ipv6 addresses Use hints in getaddrinfo() so that we can also resolve ipv6 addresses. --- gst-libs/gst/rtsp/gstrtspconnection.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index def369a149..b2a30d87e8 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -461,11 +461,20 @@ static gchar * do_resolve (const gchar * host) { static gchar ip[INET6_ADDRSTRLEN]; - struct addrinfo *aires; + struct addrinfo *aires, hints; struct addrinfo *ai; gint aierr; - aierr = getaddrinfo (host, NULL, NULL, &aires); + memset (&hints, 0, sizeof (struct addrinfo)); + hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ + hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */ + hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */ + hints.ai_protocol = 0; /* Any protocol */ + hints.ai_canonname = NULL; + hints.ai_addr = NULL; + hints.ai_next = NULL; + + aierr = getaddrinfo (host, NULL, &hints, &aires); if (aierr != 0) goto no_addrinfo;