From 23b7a6fd0765b1e43fa6a2cefed3d0ea4856bf83 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Mon, 4 Jul 2011 17:47:29 +0000
Subject: [PATCH] In bind_port(), stop hinting AI_ADDRCONFIG to getaddrinfo()

It's not strictly needed there and causes GNU libc to fail to
return loopback addresses if no non-loopback IP address is
configured on the system. Apparently this is the result of a
somewhat strict but valid interpretation of RFC 3493 and
considered a feature. Sad but true.

This is mainly an issue if the system is using DHCP and Privoxy
is started before the network is completely configured.

Reported by Raphael Marichez in #3349356.
Additional insight from Petr Pisar.
---
 jbsockets.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/jbsockets.c b/jbsockets.c
index ecd5bd46..b00d5144 100644
--- a/jbsockets.c
+++ b/jbsockets.c
@@ -1,4 +1,4 @@
-const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.102 2011/05/03 10:11:24 fabiankeil Exp $";
+const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.103 2011/06/23 13:58:22 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
@@ -772,9 +772,6 @@ int bind_port(const char *hostnam, int portnum, jb_socket *pfd)
    }
    hints.ai_socktype = SOCK_STREAM;
    hints.ai_flags = AI_PASSIVE;
-#ifdef AI_ADDRCONFIG
-   hints.ai_flags |= AI_ADDRCONFIG;
-#endif
    hints.ai_protocol = 0; /* Really any stream protocol or TCP only */
    hints.ai_canonname = NULL;
    hints.ai_addr = NULL;
-- 
2.49.0