Skip to contentSkip to conversation

neighbour: Support broadcast ARP in neighbor PROPE state

PATCH In review zhuyj 3 participants 3 messages Feb 5, 2015 – Feb 7, 2015

Subsystems (2)
lore
Share & tools
lore

zhuyj

author
#0 lore raw

PATCH 1/1 neighbour: Support broadcast ARP in neighbor PROPE state

From: eulfsam <[email protected]>

When the neighbor statemachine is in PROBE state, it will normally send a number of unicast ARP requests (number defined in "ucast_probes" entry in the proc file system, default=3) and if no reply is received, it will change state to FAILED.

Enabling CONFIG_ARP_PROBE_BCAST, will make the statemachine try to send broadcast ARP requests, and only enter FAILED state if the broadcast ARP requests did not receive a reply.

Enabling CONFIG_ARP_PROBE_BCAST, makes the IPv4 ARP behaviour more similar to the IPv6 Neighbor Discovery protocol, and is neccessary, if the other end only responds to broadcast ARPs.

CC David S. Miller <[email protected]>
CC WANG Cong <[email protected]>
---
 net/core/neighbour.c |  4 ++++
 net/ipv4/Kconfig     | 17 +++++++++++++++++
 2 files changed, 21 insertions(+)
net/core/neighbour.c +4 -0
index 8d614c9..50f5ee2 100644
@@ -830,10 +830,14 @@ out:
 static __inline__ int neigh_max_probes(struct neighbour *n)
 {
 	struct neigh_parms *p = n->parms;
+#ifdef CONFIG_ARP_PROBE_BCAST
+	return p->ucast_probes + p->app_probes + p->mcast_probes;
+#else
 	int max_probes = NEIGH_VAR(p, UCAST_PROBES) + NEIGH_VAR(p, APP_PROBES);
 	if (!(n->nud_state & NUD_PROBE))
 		max_probes += NEIGH_VAR(p, MCAST_PROBES);
 	return max_probes;
+#endif
 }
 
 static void neigh_invalidate(struct neighbour *neigh)
net/ipv4/Kconfig +17 -0
index bd29016..4d13edb 100644
@@ -259,6 +259,23 @@ config IP_PIMSM_V2
 	  gated-5). This routing protocol is not used widely, so say N unless
 	  you want to play with it.
 
+config ARP_PROBE_BCAST
+	bool "IP: ARP send broadcast ARP, if probing using unicast fails"
+	default	y
+	---help---
+	  When the neighbor statemachine is in PROBE state, it will
+	  normally send a number of unicast ARP requests
+	  (number defined in "ucast_probes" entry in the proc file system, default=3)
+	  and if no reply is received, it will change state to FAILED.
+  
+	  Saying Y here, will make the statemachine try to send broadcast ARP
+	  requests, and only enter FAILED state if the broadcast ARP requests did not
+	  receive a reply.
+
+	  Enabling this, makes the IPv4 ARP behaviour more similar to the IPv6
+	  Neighbor Discovery protocol, and is neccessary, if the other end
+	  only responds to broadcast ARPs.
+
 config SYN_COOKIES
 	bool "IP: TCP syncookie support"
 	---help---
Signature · 1 line
1.9.1
#1 lore raw

Hello.

Quoted 3 lines · zhuyj

From: eulfsam <[email protected]>

When the neighbor statemachine is in PROBE state, it will normally send

State machine.

Quoted 5 lines

a number of unicast ARP requests (number defined in "ucast_probes" entry in the proc file system, default=3) and if no reply is received, it will change state to FAILED.

Enabling CONFIG_ARP_PROBE_BCAST, will make the statemachine try to send

Likewise.

Quoted 5 lines

broadcast ARP requests, and only enter FAILED state if the broadcast ARP requests did not receive a reply.

Enabling CONFIG_ARP_PROBE_BCAST, makes the IPv4 ARP behaviour more similar to the IPv6 Neighbor Discovery protocol, and is neccessary,

Necessary.

Quoted 6 lines

if the other end only responds to broadcast ARPs.

CC David S. Miller <[email protected]>
CC WANG Cong <[email protected]>

Need real names here.

[...]

net/ipv4/Kconfig config IP_PIMSM_V2 · line 266

Quoted 13 lines
net/ipv4/Kconfig +5 -0
index bd29016..4d13edb 100644
@@ -259,6 +259,23 @@ config IP_PIMSM_V2
  	  gated-5). This routing protocol is not used widely, so say N unless
  	  you want to play with it.
 
+config ARP_PROBE_BCAST
+	bool "IP: ARP send broadcast ARP, if probing using unicast fails"
+	default	y
+	---help---
+	  When the neighbor statemachine is in PROBE state, it will

State machine.

net/ipv4/Kconfig config IP_PIMSM_V2 · line 271

Quoted 5 lines
net/ipv4/Kconfig +5 -0
+	  normally send a number of unicast ARP requests
+	  (number defined in "ucast_probes" entry in the proc file system, default=3)
+	  and if no reply is received, it will change state to FAILED.
+
+	  Saying Y here, will make the statemachine try to send broadcast ARP

Likewise.

net/ipv4/Kconfig config IP_PIMSM_V2 · line 276

Quoted 5 lines
net/ipv4/Kconfig +5 -0
+	  requests, and only enter FAILED state if the broadcast ARP requests did not
+	  receive a reply.
+
+	  Enabling this, makes the IPv4 ARP behaviour more similar to the IPv6
+	  Neighbor Discovery protocol, and is neccessary, if the other end

Necessary.

[...]

WBR, Sergei

#2 lore raw
In reply to zhuyj

net/ipv4/Kconfig config IP_PIMSM_V2 · line 264

Quoted 11 lines · zhuyj
net/ipv4/Kconfig +3 -0
index bd29016..4d13edb 100644
@@ -259,6 +259,23 @@ config IP_PIMSM_V2
          gated-5). This routing protocol is not used widely, so say N unless
          you want to play with it.
 
+config ARP_PROBE_BCAST
+       bool "IP: ARP send broadcast ARP, if probing using unicast fails"
+       default y

Why make it default to y? Since we use the current behavior for a long time?