diff -up cups-1.3.8/config.h.in.res_init cups-1.3.8/config.h.in --- cups-1.3.8/config.h.in.res_init 2008-09-03 15:34:23.000000000 +0100 +++ cups-1.3.8/config.h.in 2008-09-03 15:34:52.000000000 +0100 @@ -365,6 +365,13 @@ /* + * Do we have __res_init()? + */ + +#undef HAVE_RES_INIT + + +/* * Do we have hstrerror()? */ diff -up cups-1.3.8/config-scripts/cups-network.m4.res_init cups-1.3.8/config-scripts/cups-network.m4 --- cups-1.3.8/config-scripts/cups-network.m4.res_init 2007-12-19 01:47:57.000000000 +0000 +++ cups-1.3.8/config-scripts/cups-network.m4 2008-09-03 15:34:14.000000000 +0100 @@ -18,6 +18,7 @@ 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)) # Tru64 5.1b leaks file descriptors with these functions; disable until # we can come up with a test for this... diff -up cups-1.3.8/scheduler/cups-polld.c.res_init cups-1.3.8/scheduler/cups-polld.c --- cups-1.3.8/scheduler/cups-polld.c.res_init 2008-01-08 00:16:30.000000000 +0000 +++ cups-1.3.8/scheduler/cups-polld.c 2008-09-03 15:34:14.000000000 +0100 @@ -155,6 +155,18 @@ main(int argc, /* I - Number of comm restart_polling = 0; httpClose(http); +#ifdef HAVE_RES_INIT + if (!http) + { + /* + * Reinit the resolver so that it doesn't cache a previous + * hostname lookup failure. This fixes the situation where a + * network interface becomes available after polling starts. + */ + __res_init (); + } +#endif /* HAVE_RES_INIT */ + if ((http = httpConnectEncrypt(argv[1], atoi(argv[2]), cupsEncryption())) == NULL) {