Index: notifier/Dependencies
===================================================================
--- notifier/Dependencies	(revision 7908)
+++ notifier/Dependencies	(working copy)
@@ -1,5 +1,8 @@
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
+dbus.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/versioning.h
+dbus.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
+dbus.o: ../cups/string.h ../config.h
 mailto.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/versioning.h
 mailto.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
 mailto.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
Index: backend/Dependencies
===================================================================
--- backend/Dependencies	(revision 7908)
+++ backend/Dependencies	(working copy)
@@ -12,12 +12,12 @@
 lpd.o: ../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 lpd.o: ../cups/language.h ../cups/debug.h ../cups/i18n.h ../cups/transcode.h
 lpd.o: ../cups/snmp-private.h ../cups/string.h
-mdns.o: backend-private.h ../cups/backend.h ../cups/versioning.h
-mdns.o: ../cups/sidechannel.h ../cups/ppd-private.h ../cups/cups.h
-mdns.o: ../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h
-mdns.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/i18n.h
-mdns.o: ../cups/transcode.h ../cups/snmp-private.h ../cups/string.h
-mdns.o: ../config.h ../cups/array.h
+dnssd.o: backend-private.h ../cups/backend.h ../cups/versioning.h
+dnssd.o: ../cups/sidechannel.h ../cups/ppd-private.h ../cups/cups.h
+dnssd.o: ../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h
+dnssd.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/i18n.h
+dnssd.o: ../cups/transcode.h ../cups/snmp-private.h ../cups/string.h
+dnssd.o: ../config.h ../cups/array.h
 pap.o: ../config.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 pap.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 pap.o: ../cups/language.h ../cups/backend.h ../cups/sidechannel.h
@@ -68,7 +68,9 @@
 testsupplies.o: ../cups/file.h ../cups/language.h ../cups/debug.h
 testsupplies.o: ../cups/i18n.h ../cups/transcode.h ../cups/snmp-private.h
 testsupplies.o: ../cups/string.h ../config.h
-usb.o: ../cups/backend.h ../cups/versioning.h ../cups/cups.h ../cups/ipp.h
-usb.o: ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h
-usb.o: ../cups/language.h ../cups/string.h ../config.h ../cups/i18n.h
-usb.o: ../cups/transcode.h
+usb.o: backend-private.h ../cups/backend.h ../cups/versioning.h
+usb.o: ../cups/sidechannel.h ../cups/ppd-private.h ../cups/cups.h
+usb.o: ../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h
+usb.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/i18n.h
+usb.o: ../cups/transcode.h ../cups/snmp-private.h ../cups/string.h
+usb.o: ../config.h
Index: config-scripts/cups-network.m4
===================================================================
--- config-scripts/cups-network.m4	(revision 7908)
+++ config-scripts/cups-network.m4	(working copy)
@@ -3,7 +3,7 @@
 dnl
 dnl   Networking stuff for the Common UNIX Printing System (CUPS).
 dnl
-dnl   Copyright 2007 by Apple Inc.
+dnl   Copyright 2007-2008 by Apple Inc.
 dnl   Copyright 1997-2005 by Easy Software Products, all rights reserved.
 dnl
 dnl   These coded instructions, statements, and computer programs are the
@@ -13,11 +13,14 @@
 dnl   file is missing or damaged, see the license at "http://www.cups.org/".
 dnl
 
+AC_CHECK_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H))
 AC_SEARCH_LIBS(socket, socket)
 AC_SEARCH_LIBS(gethostbyaddr, nsl)
 AC_SEARCH_LIBS(getifaddrs, nsl, AC_DEFINE(HAVE_GETIFADDRS))
 AC_SEARCH_LIBS(hstrerror, nsl socket resolv, AC_DEFINE(HAVE_HSTRERROR))
 AC_SEARCH_LIBS(rresvport_af, nsl, AC_DEFINE(HAVE_RRESVPORT_AF))
+AC_SEARCH_LIBS(res_init, resolv bind, AC_DEFINE(HAVE_RES_INIT),
+	AC_SEARCH_LIBS(__res_init, resolv bind, AC_DEFINE(HAVE_RES_INIT)))
 
 # Tru64 5.1b leaks file descriptors with these functions; disable until
 # we can come up with a test for this...
Index: cups/http-addrlist.c
===================================================================
--- cups/http-addrlist.c	(revision 7908)
+++ cups/http-addrlist.c	(working copy)
@@ -28,6 +28,9 @@
 #include "debug.h"
 #include <stdlib.h>
 #include <errno.h>
+#ifdef HAVE_RESOLV_H
+#  include <resolv.h>
+#endif /* HAVE_RESOLV_H */
 
 
 /*
@@ -201,6 +204,8 @@
   http_addrlist_t	*first,		/* First address in list */
 			*addr,		/* Current address in list */
 			*temp;		/* New address */
+  _cups_globals_t	*cg = _cupsGlobals();
+					/* Global data */
 
 
 #ifdef DEBUG
@@ -217,7 +222,29 @@
 	                 family == AF_INET ? "INET" : "???", service);
 #endif /* DEBUG */
 
+#ifdef HAVE_RES_INIT
  /*
+  * STR #2920: Initialize resolver after failure in cups-polld
+  *
+  * If the previous lookup failed, re-initialize the resolver to prevent
+  * temporary network errors from persisting.  This *should* be handled by
+  * the resolver libraries, but apparently the glibc folks do not agree.
+  *
+  * We set a flag at the end of this function if we encounter an error that
+  * requires reinitialization of the resolver functions.  We then call
+  * res_init() if the flag is set on the next call here or in httpAddrLookup().
+  */
+
+  if (cg->need_res_init)
+  {
+    res_init();
+
+    cg->need_res_init = 0;
+  }
+#endif /* HAVE_RES_INIT */
+
+
+ /*
   * Lookup the address the best way we can...
   */
 
@@ -246,7 +273,9 @@
     char		ipv6[1024],	/* IPv6 address */
 			*ipv6zone;	/* Pointer to zone separator */
     int			ipv6len;	/* Length of IPv6 address */
+    int			error;		/* getaddrinfo() error */
 
+
    /*
     * Lookup the address as needed...
     */
@@ -297,7 +326,7 @@
       }
     }
 
-    if (!getaddrinfo(hostname, service, &hints, &results))
+    if ((error = getaddrinfo(hostname, service, &hints, &results)) == 0)
     {
      /*
       * Copy the results to our own address list structure...
@@ -343,6 +372,9 @@
 
       freeaddrinfo(results);
     }
+    else if (error == EAI_FAIL)
+      cg->need_res_init = 1;
+
 #else
     if (hostname)
     {
@@ -459,6 +491,8 @@
 	  addr = temp;
 	}
       }
+      else if (h_errno == NO_RECOVERY)
+        cg->need_res_init = 1;
     }
 #endif /* HAVE_GETADDRINFO */
   }
Index: cups/http-addr.c
===================================================================
--- cups/http-addr.c	(revision 7908)
+++ cups/http-addr.c	(working copy)
@@ -29,10 +29,14 @@
  * Include necessary headers...
  */
 
+#include "http-private.h"
 #include "globals.h"
 #include "debug.h"
 #include <stdlib.h>
 #include <stddef.h>
+#ifdef HAVE_RESOLV_H
+#  include <resolv.h>
+#endif /* HAVE_RESOLV_H */
 
 
 /*
@@ -176,6 +180,10 @@
     char              *name,		/* I - Host name buffer */
     int               namelen)		/* I - Size of name buffer */
 {
+  _cups_globals_t	*cg = _cupsGlobals();
+					/* Global data */
+
+
   DEBUG_printf(("httpAddrLookup(addr=%p, name=%p, namelen=%d)\n",
                 addr, name, namelen));
 
@@ -193,9 +201,33 @@
 
 #ifdef AF_LOCAL
   if (addr->addr.sa_family == AF_LOCAL)
+  {
     strlcpy(name, addr->un.sun_path, namelen);
-  else
+    return (name);
+  }
 #endif /* AF_LOCAL */
+
+#ifdef HAVE_RES_INIT
+ /*
+  * STR #2920: Initialize resolver after failure in cups-polld
+  *
+  * If the previous lookup failed, re-initialize the resolver to prevent
+  * temporary network errors from persisting.  This *should* be handled by
+  * the resolver libraries, but apparently the glibc folks do not agree.
+  *
+  * We set a flag at the end of this function if we encounter an error that
+  * requires reinitialization of the resolver functions.  We then call
+  * res_init() if the flag is set on the next call here or in httpAddrLookup().
+  */
+
+  if (cg->need_res_init)
+  {
+    res_init();
+
+    cg->need_res_init = 0;
+  }
+#endif /* HAVE_RES_INIT */
+
 #ifdef HAVE_GETNAMEINFO
   {
    /*
@@ -206,9 +238,16 @@
     * do...
     */
 
-    if (getnameinfo(&addr->addr, httpAddrLength(addr), name, namelen,
-		    NULL, 0, 0))
+    int error = getnameinfo(&addr->addr, httpAddrLength(addr), name, namelen,
+		            NULL, 0, 0);
+
+    if (error)
+    {
+      if (error == EAI_FAIL)
+        cg->need_res_init = 1;
+
       return (httpAddrString(addr, name, namelen));
+    }
   }
 #else
   {
@@ -230,8 +269,10 @@
       * No hostname, so return the raw address...
       */
 
-      httpAddrString(addr, name, namelen);
-      return (NULL);
+      if (h_errno == NO_RECOVERY)
+        cg->need_res_init = 1;
+
+      return (httpAddrString(addr, name, namelen));
     }
 
     strlcpy(name, host->h_name, namelen);
Index: cups/Dependencies
===================================================================
--- cups/Dependencies	(revision 7908)
+++ cups/Dependencies	(working copy)
@@ -46,8 +46,8 @@
 http.o: http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
 http.o: ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h
 http.o: i18n.h transcode.h debug.h
-http-addr.o: globals.h string.h ../config.h http-private.h http.h
-http-addr.o: versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
+http-addr.o: http-private.h ../config.h http.h versioning.h md5.h
+http-addr.o: ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h
 http-addr.o: file.h language.h i18n.h transcode.h debug.h
 http-addrlist.o: http-private.h ../config.h http.h versioning.h md5.h
 http-addrlist.o: ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h
@@ -109,6 +109,8 @@
 testadmin.o: file.h language.h string.h ../config.h
 testarray.o: ../cups/string.h ../config.h string.h array.h versioning.h dir.h
 testarray.o: debug.h
+testconflicts.o: cups.h ipp.h http.h versioning.h ppd.h array.h file.h
+testconflicts.o: language.h string.h ../config.h
 testcups.o: cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
 testfile.o: string.h ../config.h file.h versioning.h debug.h
 testhttp.o: http-private.h ../config.h http.h versioning.h md5.h
@@ -172,8 +174,8 @@
 http.32.o: http.c  http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
 http.32.o: http.c  ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h
 http.32.o: http.c  i18n.h transcode.h debug.h
-http-addr.32.o: http-addr.c  globals.h string.h ../config.h http-private.h http.h
-http-addr.32.o: http-addr.c  versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
+http-addr.32.o: http-addr.c  http-private.h ../config.h http.h versioning.h md5.h
+http-addr.32.o: http-addr.c  ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h
 http-addr.32.o: http-addr.c  file.h language.h i18n.h transcode.h debug.h
 http-addrlist.32.o: http-addrlist.c  http-private.h ../config.h http.h versioning.h md5.h
 http-addrlist.32.o: http-addrlist.c  ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h
@@ -235,6 +237,8 @@
 testadmin.32.o: testadmin.c  file.h language.h string.h ../config.h
 testarray.32.o: testarray.c  ../cups/string.h ../config.h string.h array.h versioning.h dir.h
 testarray.32.o: testarray.c  debug.h
+testconflicts.32.o: testconflicts.c  cups.h ipp.h http.h versioning.h ppd.h array.h file.h
+testconflicts.32.o: testconflicts.c  language.h string.h ../config.h
 testcups.32.o: testcups.c  cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
 testfile.32.o: testfile.c  string.h ../config.h file.h versioning.h debug.h
 testhttp.32.o: testhttp.c  http-private.h ../config.h http.h versioning.h md5.h
@@ -298,8 +302,8 @@
 http.64.o: http.c  http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
 http.64.o: http.c  ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h
 http.64.o: http.c  i18n.h transcode.h debug.h
-http-addr.64.o: http-addr.c  globals.h string.h ../config.h http-private.h http.h
-http-addr.64.o: http-addr.c  versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
+http-addr.64.o: http-addr.c  http-private.h ../config.h http.h versioning.h md5.h
+http-addr.64.o: http-addr.c  ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h
 http-addr.64.o: http-addr.c  file.h language.h i18n.h transcode.h debug.h
 http-addrlist.64.o: http-addrlist.c  http-private.h ../config.h http.h versioning.h md5.h
 http-addrlist.64.o: http-addrlist.c  ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h
@@ -361,6 +365,8 @@
 testadmin.64.o: testadmin.c  file.h language.h string.h ../config.h
 testarray.64.o: testarray.c  ../cups/string.h ../config.h string.h array.h versioning.h dir.h
 testarray.64.o: testarray.c  debug.h
+testconflicts.64.o: testconflicts.c  cups.h ipp.h http.h versioning.h ppd.h array.h file.h
+testconflicts.64.o: testconflicts.c  language.h string.h ../config.h
 testcups.64.o: testcups.c  cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
 testfile.64.o: testfile.c  string.h ../config.h file.h versioning.h debug.h
 testhttp.64.o: testhttp.c  http-private.h ../config.h http.h versioning.h md5.h
Index: cups/globals.h
===================================================================
--- cups/globals.h	(revision 7908)
+++ cups/globals.h	(working copy)
@@ -81,6 +81,7 @@
 #  ifdef HAVE_GETADDRINFO
   char			hostname[1024];	/* Hostname */
 #  endif /* HAVE_GETADDRINFO */
+  int			need_res_init;	/* Need to reinitialize resolver? */
 
   /* ipp.c */
   ipp_uchar_t		ipp_date[11];	/* RFC-1903 date/time data */
Index: config.h.in
===================================================================
--- config.h.in	(revision 7908)
+++ config.h.in	(working copy)
@@ -394,6 +394,20 @@
 
 
 /*
+ * Do we have res_init()?
+ */
+
+#undef HAVE_RES_INIT
+
+
+/*
+ * Do we have <resolv.h>
+ */
+
+#undef HAVE_RESOLV_H
+
+
+/*
  * Do we have the <sys/sockio.h> header file?
  */
 
