|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: "reject_unknown_reverse_client_hostname" bouncing mail when name server is down
From: Jordan Russell (jr-list-2006
quo.to)
Date: Thu Aug 24 2006 - 13:54:51 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Harvey Smith wrote:
> Suppose instead you found all the packages for linux and BSD that used
> libc's getnameinfo() and contacted all the maintainers to convince
> them to implement a workaround for this bug in libc and then convinced
> all the OS vendors to backport all the new packages?
Changing Postfix to use gethostbyaddr() instead of getnameinfo() seems
infinitely simpler than upgrading all of the world's "broken" libc
packages that have been shipping in every Linux and BSD release since 1999.
Besides, Postfix is probably one of the only programs that actually has
special handling for EAI_AGAIN. Generally, programs don't have two
separate code paths for temporary and permanent name resolution failures.
It appears that adding IPv6 support to the gethostbyaddr() code -- which
again is already there but hiding behind an #ifdef -- would require
fewer than 10 lines of code.
i.e. take this:
if ((hp = gethostbyaddr((char *) &(SOCK_ADDR_IN_ADDR(sa)),
sizeof(SOCK_ADDR_IN_ADDR(sa)),
AF_INET)) == 0)
return (h_errno == TRY_AGAIN ? EAI_AGAIN : EAI_NONAME);
and expand it to:
#ifdef HAS_IPV6
if (sa->sa_family == AF_INET6) {
if ((hp = gethostbyaddr((char *) &(SOCK_ADDR_IN6_ADDR(sa)),
sizeof(SOCK_ADDR_IN6_ADDR(sa)),
AF_INET6)) == 0)
return (h_errno == TRY_AGAIN ? EAI_AGAIN : EAI_NONAME);
} else
#endif
{
if ((hp = gethostbyaddr((char *) &(SOCK_ADDR_IN_ADDR(sa)),
sizeof(SOCK_ADDR_IN_ADDR(sa)),
AF_INET)) == 0)
return (h_errno == TRY_AGAIN ? EAI_AGAIN : EAI_NONAME);
}
Then the getnameinfo() stuff could just be removed.
Problem solved instantly for all past and present Linux and BSD releases.
Later, once all the broken libc's are eradicated from the face of the
earth, it could switch back to using getnameinfo() if need be.
--
Jordan Russell
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]