[uClibc] dns_lookup in resolv.c using statics
Erik Andersen
andersen at codepoet.org
Thu Apr 28 18:30:00 UTC 2005
On Fri Dec 10, 2004 at 04:40:31PM +0100, Arne Jonsson wrote:
> Hello!
>
> I am looking at the function dns_lookup() in the file
> libc/inet/resolv.c.
> The function is using two static variables, ns and id.
> Especially the use of the variable id is wrong (I haven't check ns yet).
> I think the static id should be copied to a stack variable making it
> threadsafe. At line 805 in the file the static variable id is compared
> to the id (h.id) of an incoming packet, the problem is that id could
> have been updated of another thread during the time to receive the
> answer.
> Any comments?
Hi Arne, does this look any better?
http://uclibc.org/lists/uclibc-cvs/2005-April/005551.html
-Erik
--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
More information about the uClibc
mailing list