netdev
[Top] [All Lists]

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

To: Willy Tarreau <willy@xxxxxxxxxxxxxxxxxxx>
Subject: [PATCH] Re: [RFC] solution for the inet_ntoa problem, buffer allocator
From: Oliver Xymoron <oxymoron@xxxxxxxxx>
Date: Fri, 7 Jul 2000 12:20:46 -0500 (CDT)
Cc: linux-kernel <linux-kernel@xxxxxxxxxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <Pine.LNX.4.10.10007071038310.1903-100000@waste.org>
Sender: owner-netdev@xxxxxxxxxxx
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.." 

Attachment: ntoa-purge.patch
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] Re: [RFC] solution for the inet_ntoa problem, buffer allocator, Oliver Xymoron <=