From 5bc8da251ed01fafc097acc85e9829d28d7b14dc Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 27 Jan 2015 23:42:25 +0100 Subject: [PATCH] Set socket family to ipv4 in unspecified case on Windows. This fixes the 'Failed to bind socket "localhost:40361": Address already in use' issue. Using AF_UNSPEC shows a hidden ipv4/ipv6 issue in the dbus tcp implementation, which needs to be more investigated. --- dbus/dbus-sysdeps-win.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 18b45d0..d01bbc8 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -1666,7 +1666,7 @@ _dbus_listen_tcp_socket (const char *host, _DBUS_ZERO (hints); if (!family) - hints.ai_family = AF_UNSPEC; + hints.ai_family = AF_INET; else if (!strcmp(family, "ipv4")) hints.ai_family = AF_INET; else if (!strcmp(family, "ipv6")) -- 1.8.4.5