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: horape@xxxxxxxxxxxxxxxxxxxxxxxxxx
Date: Thu, 22 Feb 2001 04:56:19 -0300
Cc: Harald Welte <laforge@xxxxxxxxxxxx>, netfilter-devel@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20010222034032.A9151@xxxxxxxxxxxxxxxxxxxxxxxxxx>; from horape on Thu, Feb 22, 2001 at 03:40:32AM -0300
References: <20010222014141.A7501@xxxxxxxxxxxxxxxxxxxxxxxxxx> <E14VpST-0003TN-00@halfway> <20010222034032.A9151@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
User-agent: Mutt/1.3.12i
¡Hola!

> > > > I feel the point of that argument is to indicate the size of the
> > > > buffer.  We have a chance to catch coding errors; I feel the
> > > > getsockname/getpeername approach is wrong (truncate results if too
> > > > short, don't care if too long).  Unless someone can come up with a
> > > > compelling reason, why change?
> > > About truncating, i think like you, but for longer than needed it's
> > > ok to don't care and set namelen, because how is else the user know
> > > how big it is beforehand? (ie, different PF == different lens)
> > If you don't know what PF the socket is, how do you interpret the
> > result?
> getnameinfo... Normal user level code should not know what protocol it
> runs over. You should program AF independent code and let it run today
> on IPv4, tomorrow on IPv6 and in a remote time IPv7, CNLP+ or DecNet X.

BTW, that's reasonable behaviour for get[sock/peer]name, but not for
connect, sendto, etc... where it should check that namelen is the correct
(linux doesn't do that, fbsd does)

Saludos,
                                        HoraPe
---
Horacio J. Peña
horape@xxxxxxxxxxxxxxxxx
horape@xxxxxxxxxx
bofh@xxxxxxxxxxxxxx
horape@xxxxxxxxxxx

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