[Top] [All Lists]

Re: PPP-over-L2TP kernel support, patch for review

To: Martijn van Oosterhout <kleptog@xxxxxxxxx>
Subject: Re: PPP-over-L2TP kernel support, patch for review
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 8 Sep 2004 20:04:22 +1000
Cc: davem@xxxxxxxxxxxxx, jchapman@xxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20040908090455.GF18285@xxxxxxxxx>
References: <20040908073238.GB18285@xxxxxxxxx> <E1C4xe9-0005xL-00@xxxxxxxxxxxxxxxxxxxxxxxx> <20040908083828.GE18285@xxxxxxxxx> <20040908084630.GA23117@xxxxxxxxxxxxxxxxxxx> <20040908090455.GF18285@xxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040722i
On Wed, Sep 08, 2004 at 07:04:55PM +1000, Martijn van Oosterhout wrote:
> So, hypothetically, if I get passed a file descriptor through a UNIX
> domain socket and do a getname on it, there is no way to guarentee that
> it won't go past the buffer I've allocated. Who came up with this lame
> API?

Nope.  The code in net/socket.c ensures that the buffer does not overflow.

> Well, I guess I'll have to agree to that. So, lets say we create two
> new types, one for each version of the union, sockaddr_pppox_pppoe and
> sockaddr_pppox_pppol2tp. Deprecate the current sockaddr_pppox
> altogether (can't get rid of it now). Possibly create a new
> sockaddr_pppox_generic for use in the actual pppox.c file. Sprinkle
> some typecasts around to make the compiler happy and voila!

Please call them sockaddr_pppoe and sockaddr_pppol2tp.

> Then future userspace programs can use the structure appropriate for
> them. Does removing the union change the alignment on any
> architechture? Or will the dummy union have to stay in perpituity?

The union doesn't change the size or alignemnt.

Visit Openswan at
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page:
PGP Key:

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