This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
A new patch for res_init.c
- To: gafton@redhat.com
- Subject: A new patch for res_init.c
- From: hjl@lucon.org (H.J. Lu)
- Date: Fri, 11 Sep 1998 09:34:38 -0700 (PDT)
- Cc: drepper@cygnus.com (Ulrich Drepper), libc-hacker@cygnus.com (GNU C Library)
Hi, Cristian,
Could you please try this patch instead of my previous one to
see if it works with your problem?
Thanks.
--
H.J. Lu (hjl@gnu.org)
---
Index: resolv/res_init.c
===================================================================
RCS file: /home/work/cvs/gnu/glibc/resolv/res_init.c,v
retrieving revision 1.1.1.7
diff -u -p -r1.1.1.7 res_init.c
--- res_init.c 1998/09/11 13:51:34 1.1.1.7
+++ res_init.c 1998/09/11 16:31:45
@@ -207,13 +207,12 @@ res_init()
#ifdef USELOOPBACK
_res.nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
_res.nscount = 1;
- _res.nsaddr.sin_port = htons(NAMESERVER_PORT);
#else
_res.nsaddr.sin_addr.s_addr = INADDR_ANY;
_res.nscount = 0;
- _res.nsaddr.sin_port = 0;
#endif
_res.nsaddr.sin_family = AF_INET;
+ _res.nsaddr.sin_port = htons(NAMESERVER_PORT);
_res.ndots = 1;
_res.pfcode = 0;
@@ -380,7 +379,7 @@ res_init()
continue;
}
}
- if (nserv > 1)
+ if (nserv > _res.nscount)
_res.nscount = nserv;
#ifdef RESOLVSORT
_res.nsort = nsort;
@@ -573,7 +572,7 @@ netinfo_res_init(haveenv, havesearch)
ni_namelist_free(&nl);
}
- if (nserv > 1)
+ if (nserv > _res.nscount)
_res.nscount = nserv;
#ifdef RESOLVSORT