Mailing List Archive

svn commit: r434020 - /spamassassin/trunk/spamc/libspamc.c
Author: jm
Date: Wed Aug 23 05:04:00 2006
New Revision: 434020

URL: http://svn.apache.org/viewvc?rev=434020&view=rev
Log:
bug 5057: spamc was using getaddrinfo(NULL) to get localhost address info; unfortunately, on linux that returns IPv6 addressing, whereas we want to default to IPv4 unless otherwise specified. use getaddrinfo('127.0.0.1') instead

Modified:
spamassassin/trunk/spamc/libspamc.c

Modified: spamassassin/trunk/spamc/libspamc.c
URL: http://svn.apache.org/viewvc/spamassassin/trunk/spamc/libspamc.c?rev=434020&r1=434019&r2=434020&view=diff
==============================================================================
--- spamassassin/trunk/spamc/libspamc.c (original)
+++ spamassassin/trunk/spamc/libspamc.c Wed Aug 23 05:04:00 2006
@@ -1573,10 +1573,13 @@
return EX_OK;
#endif
case TRANSPORT_LOCALHOST:
- /* getaddrinfo(NULL) will look up the loopback address */
- if ((origerr = getaddrinfo(NULL, port, &hints, &res)) != 0) {
+ /* getaddrinfo(NULL) will look up the loopback address.
+ * bug 5057: unfortunately, it's the IPv6 loopback address on
+ * linux! Be explicit, and force IPv4 using "127.0.0.1".
+ */
+ if ((origerr = getaddrinfo("127.0.0.1", port, &hints, &res)) != 0) {
libspamc_log(flags, LOG_ERR,
- "getaddrinfo(NULL) failed: %s",
+ "getaddrinfo(127.0.0.1) failed: %s",
gai_strerror(origerr));
return EX_OSERR;
}