netdev
[Top] [All Lists]

Re: [PATCH] SO_ORIGINAL_DST and sockaddr_in

To: Harald Welte <laforge@xxxxxxxxxxxx>
Subject: Re: [PATCH] SO_ORIGINAL_DST and sockaddr_in
From: Rusty Russell <rusty@xxxxxxxxxxxxxxxx>
Date: Wed, 21 Feb 2001 15:27:31 +1100
Cc: netfilter-devel@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: Your message of "Thu, 15 Feb 2001 09:21:40 BST." <20010215092140.Z27130@xxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
In message <20010215092140.Z27130@xxxxxxxxxxxxxxxxxxxxxx> you write:
> On Wed, Feb 07, 2001 at 06:30:07PM +0100, Balazs Scheidler wrote:
> > Hi,
> > 
> > SO_ORIGINAL_DST requires a sockaddr buffer with size equal to sizeof(struct
> > sockaddr_in)), this is broken in my opinion, a buffer with at least
> > sizeof(struct sockaddr_in)) bytes should be enough. Trivial patch is below:
> 
> I think you're right. there's no point in rejecting a 'too big' buffer.

Is there a point in allowing a too-big buffer?  I know that
getpeername() and getsockname() do, but it's an indication of an error
on the user code, to me.

Is there some convincing argument I am missing?
Rusty.
--
Premature optmztion is rt of all evl. --DK

<Prev in Thread] Current Thread [Next in Thread>