This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch for resolver (Re: Glibc 2.2 is broken)


On Wed, Jul 19, 2000 at 05:10:37PM -0700, Ulrich Drepper wrote:
> "H . J . Lu" <hjl@lucon.org> writes:
> 
> > We should provide symbol versioning for it.
> 
> We should investigate restricting the size of the new struct first (as
> I've explained in the last message).

It seems to work for me. We should check on alpha, sparc, .....
to make sure the size is not changed.

> 
> And HJ: please use a subject like "resolver in glibc 2.2 broken".  It
> does not help anybody seeing a subject like "Glibc 2.2 is broken".  I
> need a more descriptive subjects (since I have hundreds of mails in
> the bugs folder) and others should not be discouraged by reading
> something like that.
> 

Sure.

H.J.
----
2000-07-19  H.J. Lu  <hjl@gnu.org>

	* resolv/resolv.h (__res_state): Make sure it is 512 bytes on
	ia32. Remove bogus padding.

Index: resolv/resolv.h
===================================================================
RCS file: /work/cvs/gnu/glibc/resolv/resolv.h,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 resolv.h
--- resolv/resolv.h	2000/07/19 22:17:39	1.1.1.2
+++ resolv/resolv.h	2000/07/20 00:34:33
@@ -123,6 +123,13 @@ struct res_sym {
 #define	RES_DFLRETRY		2	/* Default #/tries. */
 #define	RES_MAXTIME		65535	/* Infinity, in milliseconds. */
 
+/* The size of struct __res_state has to be 512 bytes on ia32. It
+   cannot be changed without breaking the existing ABI. We can adjust
+   DEFDNAME_LEN here to make sure sizof (struct __res_state) is
+   512 bytes on ia32.
+ */
+#define DEFDNAME_LEN	240
+
 struct __res_state {
 	int	retrans;	 	/* retransmition time interval */
 	int	retry;			/* number of times to retransmit */
@@ -133,7 +140,7 @@ struct __res_state {
 #define	nsaddr	nsaddr_list[0]		/* for backward compatibility */
 	u_short	id;			/* current message id */
 	char	*dnsrch[MAXDNSRCH+1];	/* components of domain to search */
-	char	defdname[256];		/* default domain (deprecated) */
+	char	defdname[DEFDNAME_LEN];	/* default domain (deprecated) */
 	u_long	pfcode;			/* RES_PRF_ flags - see below. */
 	unsigned ndots:4;		/* threshold for initial abs. query */
 	unsigned nsort:4;		/* number of elements in sort_list[] */
@@ -148,7 +155,6 @@ struct __res_state {
 	int	_vcsock;		/* PRIVATE: for res_send VC i/o */
 	u_int	_flags;			/* PRIVATE: see below */
 	union {
-		char	pad[52];	/* On an i386 this means 512b total. */
 		struct {
 			u_int16_t		nscount;
 			u_int16_t		nstimes[MAXNS];	/* ms. */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]