[PATCH] Re: [RFC] solution for the inet_ntoa problem, buffer allocator

From: Oliver Xymoron (oxymoron@waste.org)
Date: Fri Jul 07 2000 - 12:20:46 EST


On Fri, 7 Jul 2000, Oliver Xymoron wrote:

> On Fri, 7 Jul 2000, Willy Tarreau wrote:
>
> > > Not threadsafe.
> >
> > Hmmm, I forgot that aspect :-/
>
> I'm gonna post a cleanup patch that kills in_ntoa entirely. The right way
> to do it is in_ntoa2 which and local buffers ala sprintf.

Ok, here's a completely untested but very straightforward patch that
removes in_ntoa and replaces all uses with in_ntoa2. In_ntoa wasn't
threadsafe so every use was a potential race and it was being called
multiple times for printk args. Alternatives discussed included hacking
printk to print IP addresses (doesn't fix all uses and compiler complains)
and adding some sort of allocator to in_ntoa (ugly, still not threadsafe).

I'd like to kill NIPQUAD (and definitely HIPQUAD) in favor of in_ntoa2 as
it looks like one argument in an argument list but is magically four. It
also doesn't have an obvious analog for IPv6, which is doing rather ugly
things currently.

--
 "Love the dolphins," she advised him. "Write by W.A.S.T.E.." 


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jul 07 2000 - 21:00:21 EST