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
|