Hi Team,
Had a doubt regarding Optimistic DAD implementation in linux kernel.
The RFC of Optimistic DAD states:
"Section 3.3
A router SHOULD NOT configure an Optimistic Address."
To check the same there is a condition in kernel code wherein we check if
ipv6.devconf_all is set.
Now, my query is that we are checking if forwarding is enabled on all
interfaces, then we consider the system to be a router.
But even if forwarding is enabled from few interfaces(not all) isn't the system
behaving like a router?
void
addrconf_add_linklocal<https://elixir.bootlin.com/linux/latest/ident/addrconf_add_linklocal>(struct
inet6_dev<https://elixir.bootlin.com/linux/latest/ident/inet6_dev>
*idev<https://elixir.bootlin.com/linux/latest/ident/idev>,
const struct
in6_addr<https://elixir.bootlin.com/linux/latest/ident/in6_addr> *addr,
u32<https://elixir.bootlin.com/linux/latest/ident/u32> flags)
{
.
.
.
.
#ifdef<https://elixir.bootlin.com/linux/latest/ident/ifdef>
CONFIG_IPV6_OPTIMISTIC_DAD
if
((dev_net<https://elixir.bootlin.com/linux/latest/ident/dev_net>(idev<https://elixir.bootlin.com/linux/latest/ident/idev>->dev)->ipv6.devconf_all->optimistic_dad
||
idev<https://elixir.bootlin.com/linux/latest/ident/idev>->cnf.optimistic_dad) &&
!dev_net<https://elixir.bootlin.com/linux/latest/ident/dev_net>(idev<https://elixir.bootlin.com/linux/latest/ident/idev>->dev)->ipv6.devconf_all->forwarding<https://elixir.bootlin.com/linux/latest/ident/forwarding>)
cfg<https://elixir.bootlin.com/linux/latest/ident/cfg>.ifa_flags |=
IFA_F_OPTIMISTIC<https://elixir.bootlin.com/linux/latest/ident/IFA_F_OPTIMISTIC>;
#endif
.
.
.
.
}
Thanks
Chinmay
_______________________________________________
Kernelnewbies mailing list
[email protected]
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies