[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

selfaddrs.c bug in 2.99.50s19 (and others ?)

In said file (lib/selfaddrs.c), matchmyaddress() does not correctly
compare addresses for AF_INET because it compares the first 4 bytes
of sockaddr, instead of sockaddr.sa_data.

This causes (among other things ?) some valid MXs to compare ok to
myaddress and in so not to be taken into account. This leads
to smtp error "No Mx no A record for host foo" 

Sorry, no diffs, but corrected code is:

        for (i = 0; i < nmyaddrs; ++i) {
          /* if this is myself, skip to next MX host */
          if (sa->sa_family == myaddrs[i]->sa_family) {
            if (sa->sa_family == AF_INET && memcmp(sa->sa_data, myaddrs[i]->sa_d
              return 1;
#if defined(AF_INET6) && defined(INET6)
            if (sa->sa_family == AF_INET6 && memcmp(sa, myaddrs[i], 16) == 0)
              return 1;
        return 0;