From d7f9e64824f6231d21598b54568ea670b8b45968 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 20 Nov 2009 22:49:57 +0100 Subject: [PATCH] allow AF_INET6 in libmpdclient since mpd supports it Thanks to Kaleb Elwert (belak, IRC) who reported the problem and tested the fix. --- ChangeLog | 3 +++ src/libmpdclient.c | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f2e436d6..9ada263e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2009-11-20 + * Allow for mpd connections to use IPv6 + 2009-11-19 * Added support for $pid_read and $pid_write diff --git a/src/libmpdclient.c b/src/libmpdclient.c index 9a5067ea..4e789aa3 100644 --- a/src/libmpdclient.c +++ b/src/libmpdclient.c @@ -129,13 +129,9 @@ static int mpd_connect(mpd_Connection *connection, const char *host, int port, struct addrinfo *res = NULL; struct addrinfo *addrinfo = NULL; - /* Setup hints - * - * XXX: limit address family to PF_INET here. - * MPD does not support IPv6 yet, so if GAI returns - * an IPv6 address, the later connect() will fail. */ + /* Setup hints */ hints.ai_flags = AI_ADDRCONFIG; - hints.ai_family = PF_INET; + hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; hints.ai_addrlen = 0;