tech-net archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: IPv6: what is required of lower layers?
mouse%Rodents-Montreal.ORG@localhost (Mouse) writes:
>[Michael van Elst]
>>> that, and now I'm getting packets, but they're addressed to a
>>> multicast address, ff02:3::1:ff02:2, not the address userland is
>>> sending to.
>> I would guess that's an embedded scope (and must not appear on the wire).
>> sin6->sin6_addr.s6_addr16[1] = htons(zoneid & 0xffff);
>> where zoneid for a link-local address like ff02:: (or an
>> interface-local address) is the interface index.
>Curious. My code is printing the address prepended by tun, not the
>destination address in the packet; looking at if_tun.c (which I _have_
>modified), this is the address in the third argument to tun's if_output
>(const struct sockaddr *dst). What, if anything, is the v6 stack
>expecting the network interface to do with this address?
An ethernet interface would use *dst to get the MAC address to
send the packet to. And that's where it needs the interface index
to look up a link-local destination in the (single) neighbour cache.
This is probably the reason to make ambigous link-local addresses
system-wide unique by embedding the interface index.
The tun client (who reads /dev/tun* and the prepended address) may
need to do something similar, that's why it gets the scoped address.
Home |
Main Index |
Thread Index |
Old Index