ipv4: arp: process only if ipv4 address configured
Subsystems (3)
PATCH 1/1 ipv4: arp: process only if ipv4 address configured
8030f54499925d073a88c09f ([IPV4] devinet: Register inetdev earlier.) changed arp behaviour (2.6.22 onwards).
Before this, inetdev_init() was called only when the first address was added to the interface, i.e. arp_process always dropped incoming arp packets as __in_dev_get_rcu() returned NULL when no IP address was set on the interface.
With >= 2.6.22 we now process arp packets even if no address is assigned. It can cause issues if the machine has several interfaces in the same segment; requests receive answers from multiple macs.
---
IMO such configurations are just asking for trouble, but it used to work on older kernels. Do we care about such setups?
net/ipv4/arp.c +1 -1
@@ -738,7 +738,7 @@ static int arp_process(struct sk_buff *skb)* is ARP'able. */ -if (in_dev ==NULL ) +if (in_dev ==NULL || in_dev->ifa_list ==NULL ) goto out; arp =arp_hdr (skb);
Signature · 1 line
1.8.1.5
Quoted 11 lines · Florian Westphal
8030f54499925d073a88c09f([IPV4] devinet: Register inetdev earlier.) changed arp behaviour (2.6.22 onwards).Before this,
inetdev_init()was called only when the first address was added to the interface, i.e.arp_processalways dropped incoming arp packets as__in_dev_get_rcu()returned NULL when no IP address was set on the interface.With >= 2.6.22 we now process arp packets even if no address is assigned. It can cause issues if the machine has several interfaces in the same segment; requests receive answers from multiple macs.
What about arp_filter value/meaning ?
Quoted 9 lines · Eric Dumazet
Quoted 8 lines · Florian Westphal
8030f54499925d073a88c09f([IPV4] devinet: Register inetdev earlier.) changed arp behaviour (2.6.22 onwards).Before this,
inetdev_init()was called only when the first address was added to the interface, i.e.arp_processalways dropped incoming arp packets as__in_dev_get_rcu()returned NULL when no IP address was set on the interface.
Quoted 5 lines
Quoted 3 lines
With >= 2.6.22 we now process arp packets even if no address is assigned. It can cause issues if the machine has several interfaces in the same segment; requests receive answers from multiple macs.
What about
arp_filtervalue/meaning ?
Sure, arp_filter=1 avoids this.
If you mean "we don't care, its been like this for years and if you don't want it then set arp_filter=1" -- fine with me.
Sorry if this wasn't clear -- its more about the change in behaviour and if we should care.
Quoted 11 lines · Florian Westphal
8030f54499925d073a88c09f([IPV4] devinet: Register inetdev earlier.) changed arp behaviour (2.6.22 onwards).Before this,
inetdev_init()was called only when the first address was added to the interface, i.e.arp_processalways dropped incoming arp packets as__in_dev_get_rcu()returned NULL when no IP address was set on the interface.With >= 2.6.22 we now process arp packets even if no address is assigned. It can cause issues if the machine has several interfaces in the same segment; requests receive answers from multiple macs.
I actually expect arp answers for ip addresses bound to loopback even from an interface without ip address, if we strictly conform to the week end host model in linux.
This is e.g. a common setup for BGP routers, where you assign the IBGP address to loopback or dummy and thus make it interface independent.
Greetings,
Hannes
David Miller
maintainerFrom: Hannes Frederic Sowa <[email protected]>
Date: Thu, 13 Feb 2014 01:24:13 +0100
Quoted 3 lines
I actually expect arp answers for ip addresses bound to loopback even from an interface without ip address, if we strictly conform to the week end host model in linux.
Agreed.
Quoted 8 lines · David Miller
From: Hannes Frederic Sowa <[email protected]>
Date: Thu, 13 Feb 2014 01:24:13 +0100Quoted 3 lines
I actually expect arp answers for ip addresses bound to loopback even from an interface without ip address, if we strictly conform to the week end host model in linux.
Agreed.
Thanks for your inpout everyone. I've self-rejected the patch.