netdev
[Top] [All Lists]

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

To: "David S. Miller" <davem@xxxxxxxxxxxxx>
Subject: Re: PPP-over-L2TP kernel support, patch for review
From: Martijn van Oosterhout <kleptog@xxxxxxxxx>
Date: Wed, 8 Sep 2004 17:32:41 +1000
Cc: James Chapman <jchapman@xxxxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <20040907155657.2ab6a4bb.davem@xxxxxxxxxxxxx>
References: <1094471956.413c5114de2d7@xxxxxxxxxxxxxxx> <20040907155657.2ab6a4bb.davem@xxxxxxxxxxxxx>
Reply-to: Martijn van Oosterhout <kleptog@xxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.28i
On Tue, Sep 07, 2004 at 03:56:57PM -0700, David S. Miller wrote:
> On Mon,  6 Sep 2004 12:59:16 +0100
> James Chapman <jchapman@xxxxxxxxxxx> wrote:
> 2) Does this:
> 
>  struct sockaddr_pppox { 
>         sa_family_t     sa_family;            /* address family, AF_PPPOX */ 
>         unsigned int    sa_protocol;          /* protocol identifier */ 
>         union{ 
>                 struct pppoe_addr       pppoe; 
> +               struct pppol2tp_addr    pppol2tp;
>         }sa_addr; 
>  }__attribute__ ((packed)); 
> 
>    Change the size of sockaddr_pppox on any platform?  If so, you'll
>    break pppox userspace with this change so we'd need find another
>    way to do it.

By my calculations, 

sizeof(struct pppoe_addr) = 2 + ETH_ALEN + IFNAMSIZ = 2 + 6 + 16 = 24 bytes
sizeof(struct pppol2tp_addr) = sizeof(int) + sizeof(sockaddr_in) + 4 * 2
                             = 4 + 16 + 8 = 28 + possibly padding

So the answer is: I think so. However, I'm not sure why this is an
issue. struct sockaddr is passed back and forth between userspace and
kernelspace has many varying sizes (sockaddr_un is quite large). What
could be affected? getsockname, connect and bind all take a length
argument. Or are you referring to the possibility of it affecting other
structures it's embedded in?

TIA,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment: pgppWqWpj2pRY.pgp
Description: PGP signature

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