Hello!
> How would you do that for an skb with a IPv6 packet?
Currently there is no simple way to get this. Simply it is not
required, because it is controlled not by flags but by input method.
One receipt is !dst->error && dst->dev == loopback,
another one is dst->input == ip6_input.
> I want to know if an arbitrary IPv6 address is an on-link address for
> the receiving node,
> and I need to check the prefix length of the subnet corresponding to
> this link.
What is problem? Scan address list and check this. Kernel never
needs to know such information (actually, it is not well-defined in IPv6),
so that such routine is missing.
I have strong impression that if some protocol needs to ask questions
sort of "A is on-link or not?", it is the first candidate to be moved
to user space. It is pure policy issue in IPv6. F.e. redirected address
is on-link or not on-link? For kernel it is simply meaningless.
> Finally, how does a node know if it is a router itself? (probably a
> #define)
It is variable ipv6_devconf.forwarding.
Alexey
|