logo       

problem in __dns_lookup (resolv.c): msg#00190

lib.uclibc.general

Subject: problem in __dns_lookup (resolv.c)

--- resolv.c.org Thu Oct 31 11:03:49 2002
+++ resolv.c Thu Oct 31 11:04:33 2002
@@ -641,7 +641,9 @@

/* Mess with globals while under lock */
LOCK;
- h.id = ++id;
+ ++id;
+ id &= 0xffff;
+ h.id = id;
dns = nsip[ns];
UNLOCK;

The above patch should be applied to resolv.c

because __encode_header/__decode_header only deal with the lower 16 bits of
'id',
when 'id' is greater than 0xffff, the following code has a problem. ('h.id'
cannot be equal to 'id'.)

LOCK;
if ((h.id != id) || (!h.qr)) {
UNLOCK;
/* unsolicited */
goto again;
}
UNLOCK;

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise