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.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
|