Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

spamd check -> EAI_BADFLAGS on getaddrinfo()

2009-02-14 by Enrico Scholz

Hi,

the ISC bind library does not seem to like the AI_ADDRCONFIG flag for
getaddrinfo().  E.g.

---
#include <netdb.h>
#include <stdio.h>

int main()
{
        struct addrinfo *ai;
        struct addrinfo hints = {
                .ai_socktype = SOCK_STREAM,
                .ai_flags    = AI_ADDRCONFIG
        };

        printf("rc=%d\n", getaddrinfo("localhost", "1234", &hints, &ai));
}
---

gives

$ gcc foo.c ; ./a.out 
rc=0

$ gcc foo.c -lbind -I/usr/include/bind; ./a.out 
rc=3


Used libraries are glibc-2.9-3.x86_64 and bind-libs-9.5.1-1.P1.fc10.x86_64
on Fedora 10, but issue was seen on CentOS 5 too.



Setting ai_flags to AI_ADDRCONFIG is done by milter-greylist and problem
will occur when dnsrbl checks are enabled (which cause linking against
libbind).


What would be the best solution?  Using NULL pointer instead of &hints?
Or checking result for EAI_BADFLAGS and invoking getaddrinfo() again
without AI_ADDRCONFIG?



Enrico

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.