Penned by Simon Perreault on 20120830 13:47.22, we have:
| Hi,
|
| Is it normal that getifaddrs() leaks the kernel's scope ID
| representation of IPv6 link-local addresses?
|
| In other words, is every user of getifaddrs() expected to fill the
| sin6_scope_id member from the 3rd byte of the address, and then
| clear that byte?
|
| Looking at ifconfig.c, it's full of calls to this function:
|
| >void
| >in6_fillscopeid(struct sockaddr_in6 *sin6)
| >{
| >#ifdef __KAME__
| > if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
| > sin6->sin6_scope_id =
| > ntohs(*(u_int16_t *)&sin6->sin6_addr.s6_addr[2]);
| > sin6->sin6_addr.s6_addr[2] = sin6->sin6_addr.s6_addr[3] = 0;
| > }
| >#endif /* __KAME__ */
| >}
|
| Shouldn't this be done once in getifaddrs() itself instead of
| replicated everywhere it's used?
|
| Simon
I'm sure people will correct me if I am misremembering but .. to the best of
my understanding...
It would be ideal for the kernel to use the sin6_scope_id when communicating
with
userland everywhere, and never should the userland have to do the horrendous
hacks required to clear this from the s6_addr[2] and s6_addr[3] fields.
No one has taken this on, and so this desire for cleaning the ugly mess KAME
left
us has been left undone.
Thanks,
--
Todd Fries .. [email protected]
_____________________________________________
| \ 1.636.410.0632 (voice)
| Free Daemon Consulting, LLC \ 1.405.227.9094 (voice)
| http://FreeDaemonConsulting.com \ 1.866.792.3418 (FAX)
| 2525 NW Expy #525, Oklahoma City, OK 73112 \ sip:[email protected]
| "..in support of free software solutions." \ sip:[email protected]
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
37E7 D3EB 74D0 8D66 A68D B866 0326 204E 3F42 004A
http://todd.fries.net/pgp.txt