Date: Wed, 25 Jan 95 8:37:55 MST From: terry@cs.weber.edu (Terry Lambert) To: hackers@FreeBSD.org Subject: sendmail 8.6.9 - "Name server failure" problem (fwd) Message-ID: <9501251537.AA18261@cs.weber.edu>
next in thread | raw e-mail | index | archive | help
The following is from a friend of mine; he's already informed Eric and Paul, but I thought you might not want to wait for the next release of sendmail (or the previous release of BIND) to get your mail working. This is also a potentially generic problem for anyone moving from the old to the new resolver code for *any* application. Terry Lambert terry@cs.weber.edu --- Any opinions in this posting are my own and not those of my present or previous employers. ======================================================================== Forwarded message: > From mday@artisoft.com Tue Jan 24 20:49:51 1995 > Date: Tue, 24 Jan 1995 20:54:56 -0700 > From: Matt Day <mday@artisoft.com> > Message-Id: <199501250354.UAA04640@sting.artisoft.com> > To: sendmail@CS.Berkeley.EDU > Subject: sendmail 8.6.9 - "Name server failure" problem > Cc: bind-workers@vix.com, volkerdi@mhd1.moorhead.msus.edu > > Hi, > > After upgrading my Linux system to sendmail 8.6.9 and BIND 4.9.3-BETA9 > (including the libc resolver routines), sendmail started leaving > incoming mail messages sitting in the mail queue with a "Name server > failure" error. My name server seemed to work for other applications > just fine, so this problem intrigued me. I tracked down the problem to > the hostnamebyanyaddr() routine in src/daemon.c. This routine saves the > value of _res.retry to a temporary variable and sets _res.retry to 3, > makes some resolver calls, and then restores _res.retry to its previous > value. But, the BIND 4.9.3 resolver routines no longer statically > initialize the global _res structure like older versions of the resolver > routines, leaving it to be initialized to 0 by default and later > initialized to proper values when res_init() is called. (See res_init() > in the BIND 4.9.3 code for more details.) > > So, since no resolver calls have been made at the time > hostnamebyanyaddr() gets first called, _res.retry is 0 (res_init() > hasn't been called yet), so sendmail saves _res.retry, sets it to 3, > calls a resolver routine which calls res_init(), and then restores > _res.retry to 0. Later, when sendmail makes another resolver call, > res_init() isn't called again (res_init() was called already when the > previous resolver call was made) so _res.retry gets left set to 0, which > causes the resolver routines to return the ECONNREFUSED error (because > no attempts are made to contact a name server), which sendmail > interprets as "Name server failure". > > So, the problem is hostnamebyanyaddr() assumes that _res is already > initialized to proper values, but this is no longer true as of BIND > 4.9.3. Here is a patch for sendmail 8.6.9 which changes > hostnamebyanyaddr() to make sure res_init() has been called before using > _res.retry. > > *** src/daemon.c- Mon Apr 18 06:48:41 1994 > --- src/daemon.c Tue Jan 24 19:38:06 1995 > *************** > *** 1406,1411 **** > --- 1406,1414 ---- > int saveretry; > > #if NAMED_BIND > + /* need to make sure _res.retry is initialized before using it */ > + if ((_res.options & RES_INIT) == 0) > + res_init(); > /* shorten name server timeout to avoid higher level timeouts */ > saveretry = _res.retry; > _res.retry = 3; > > Thanks, > > Matt Day <mday@artisoft.com> > ========================================================================
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9501251537.AA18261>