Hi Antonio,
On Fri, Feb 15, 2019 at 04:36:08PM +1000, Antonio Quartulli wrote:
Is there any situation where an OS would reject a gracious ARP? Or are they always blindly accepted and processed accordingly? If they have any protection against any misuse, I guess batman-adv should try to do the same.
I have played some more with gratuitous ARPs and this is what I could find out:
sysfs, /proc/sys/net/ipv4/conf/<iface>/*arp*:
drop_gratuitous_arp = 0 (default) arp_accept = 0 (default) -> no new address added via gratuitous ARP cmp.: https://elixir.bootlin.com/linux/v4.20.10/source/net/ipv4/arp.c#L872 -> but existing entries are updated
drop_gratuitous_arp = 1: -> grat. ARP ignored completely cmp.: https://elixir.bootlin.com/linux/v4.20.10/source/net/ipv4/arp.c#L776
drop_gratuitous_arp = 0 (default) arp_accept = 1 -> grat. ARP Reply updates existing entries and creates new ones
Also, I noticed that using a zero MAC address for the ethernet header destination did not work. Even if setting promisc-mode on the veth in its extra network namespace interface, the neighbor table would not be populated. Using the broadcast MAC for the ethernet header (and arp_accept = 1) worked, though. But would defeat the idea of using gratuitous ARP to populate the DHT without flooded messages. I wasn't able to spot where the ethernet destination is checked yet.
Regards, Linus