netdev
[Top] [All Lists]

Re: [PATCH] SO_ORIGINAL_DST and sockaddr_in

To: Rusty Russell <rusty@xxxxxxxxxxxxxxxx>
Subject: Re: [PATCH] SO_ORIGINAL_DST and sockaddr_in
From: Harald Welte <laforge@xxxxxxxxxxxx>
Date: Wed, 21 Feb 2001 16:22:53 +0100
Cc: netfilter-devel@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <E14VQsF-0007fj-00@halfway>; from rusty@xxxxxxxxxxxxxxxx on Wed, Feb 21, 2001 at 03:27:31PM +1100
References: <20010215092140.Z27130@xxxxxxxxxxxxxxxxxxxxxx> <E14VQsF-0007fj-00@halfway>
Sender: owner-netdev@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
On Wed, Feb 21, 2001 at 03:27:31PM +1100, Rusty Russell wrote:
> 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.

Hm. This sounds like an issue of interpretation. I have the following
opinion: As long as there's enough space for netfilter/iptables to write
its data in: don't care. 

The reason of this check is to know we have enough space.. isn't it?

> Is there some convincing argument I am missing?

As somebody else pointed out: If you want to use one allocated buffer 
for several things (no, I don't want to talk about programming style).
> Rusty.
> --
> Premature optmztion is rt of all evl. --DK
> 

-- 
Live long and prosper
- Harald Welte / laforge@xxxxxxxxxxxx                http://www.gnumonks.org
============================================================================
GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M- 
V-- PS+ PE-- Y+ PGP++ t++ 5-- !X !R tv-- b+++ DI? !D G+ e* h+ r% y+(*)

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