the following patch fixes two bugs related to dccproc functioning when the 
kernel doesn't support AF_INET6.

dcc_udp_bind is cloberring errno before using it... and is testing for the 
wrong errno... it needs to test for EAFNOSUPPORT.  i probably should have 
dropped the EPFNOSUPPORT tests, but i'll let someone else decide on that.

with this change i'm seeing functioning DCC support in spamassassin again.  
(oddly everything jfw on my i386 box w/o ipv6 ... and it was only when i 
went to x86_64 that i started to see these failures... i dunno why.)

-dean

--- dcc-1.2.74.orig/dcclib/get_port.c   2005-03-17 22:02:55.000000000 -0800
+++ dcc-1.2.74/dcclib/get_port.c        2006-07-24 16:02:13.590779055 -0700
@@ -530,11 +530,14 @@ dcc_udp_bind(DCC_EMSG emsg,
 #endif
        *fdp = socket(sup->sa.sa_family, SOCK_DGRAM, 0);
        if (*fdp == INVALID_SOCKET) {
+               int saved_errno = errno;
                dcc_pemsg(EX_OSERR, emsg, "socket(UDP): %s", ERROR_STR());
+               errno = saved_errno;
 #ifndef NO_IPV6
                /* let the caller try again if this system does not do IPv6 */
                if (sup->sa.sa_family == AF_INET6
                    && (errno == EPFNOSUPPORT
+                       || errno == EAFNOSUPPORT
                        || errno == EPROTONOSUPPORT))
                        return 1;
 #endif
@@ -587,6 +590,7 @@ dcc_udp_bind(DCC_EMSG emsg,
 #ifndef NO_IPV6
                        if (sup->sa.sa_family == AF_INET6
                            && (errno == EPFNOSUPPORT
+                               || errno == EAFNOSUPPORT
                                || errno == EPROTONOSUPPORT))
                                i = 1;
                        else


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to