spamhaus / rbldnsd

A small and fast DNS daemon especially made to serve DNSBL zones.
https://rbldnsd.io/
GNU General Public License v2.0
57 stars 12 forks source link

Test failure: unknown address family (10) #5

Closed orlitzky closed 3 years ago

orlitzky commented 6 years ago

Hi, we've got a bug report over at https://bugs.gentoo.org/647168 and the root cause of the test failure is the following,

rbldnsd: unknown address family (10)

which kills the daemon (and then the tests obviously fail). That error can be traced to the function...

static inline int sockaddr_equal(const struct sockaddr *addr1,
                                 const struct sockaddr *addr2)
{
  if (addr1->sa_family != addr2->sa_family)
    return 0;
  switch (addr1->sa_family) {
  case AF_INET:
    return sockaddr_in_equal((const struct sockaddr_in *)addr1,
                             (const struct sockaddr_in *)addr2);
#ifndef NO_IPv6
    return sockaddr_in6_equal((const struct sockaddr_in6 *)addr1,
                              (const struct sockaddr_in6 *)addr2);
#endif
    default:
      error(0, "unknown address family (%d)", addr1->sa_family);
  }
}

Now, I'm not quite sure what I'm looking at yet, but: doesn't it look like there's a missing case AF_INET6 there, right above the return sockaddr_in6_equal(... line?

spamhaus commented 6 years ago

Hello,

sorry for the delay. I haven't been able to reproduce the problem but what you suggest is indeed correct. I've committed the fix a while ago. Please confirm if it fixes your issue.

Thanks.

orlitzky commented 6 years ago

I was never able to reproduce it, and the original reporter was running a tinderbox (a continuous integration build server type thing) whose configuration from 6 months ago isn't easy to reproduce. So, I'm not 100% sure that it's fixed, but we've done all we can do. Thanks for your help =)