netdev
[Top] [All Lists]

Re: sin6_scope_id

To: netdev@xxxxxxxxxxx
Subject: Re: sin6_scope_id
From: Hideaki YOSHIFUJI <yoshfuji@xxxxxxxxxxxxxxxxx>
Date: Fri, 14 Jan 2000 11:08:43 +0900
In-reply-to: <200001140114.RAA31198@xxxxxxxxxxxxxxxx>
References: <200001140114.RAA31198@xxxxxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
In article <200001140114.RAA31198@xxxxxxxxxxxxxxxx> (at Thu, 13 Jan 2000 
17:14:14 -0800), David Jeffery <lordbeatnik@xxxxxxxxxxxxxx> says:

> Alexey can't just add the sin6_scope_id field. It would break userspace.
:
> from my limited experiance with the ip6 stack, it would seem possible to play 
> games like:
> 
>       if (addr_len < SOCKADDR_IN6_MIN))
>               return -EINVAL;
> 
> and
>       if(userlen >= sizeof(struct sockaddr_in6))
>               copy_from_user(..., sizeof(struct sockaddr_in6);
>       else if(userlen >= SOCKADDR_IN6_MIN))
>               copy_from_user(..., SOCKADDR_IN6_MIN);
> 
> where SOCKADDR_IN6_MIN is the size of sockaddr_in6 without sin6_scope_id.
> You'd also have to make sure sin6_scope_id inits to 0 when dealing with 
> scope_id-less userspace

I agree.  We've already discussed on this transitional problem, and the
solition we reached at that time is similar to yours.  The differences 
is that we should use sizeof(struct sockaddr_in6_min) instead of numeric 
constant to avoid alignment problem.

-- 
Hideaki YOSHIFUJI <yoshfuji@xxxxxxxxxxxxxxxxx>
Web Page: http://www.ecei.tohoku.ac.jp/%7Eyoshfuji/
PGP5i FP: F731 6599 5EB2 BBA7 1515  1323 1806 A96F 5700 6B25 

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