mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
rtspconnection: allow for more ipv6 addresses
Use hints in getaddrinfo() so that we can also resolve ipv6 addresses.
This commit is contained in:
parent
dcc4b25686
commit
999cc34c83
1 changed files with 11 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue