aboutsummaryrefslogtreecommitdiffstats
path: root/main/linux-grsec/0001-neigh-probe-application-via-netlink-in-NUD_PROBE.patch
blob: 5f6f2ba22c7d1f58d90b663e343a8e7c812211e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 0b63dd101a0cc90da984c70584e40e36cb176d30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Wed, 26 Feb 2014 11:43:04 +0200
Subject: [PATCH] neigh: probe application via netlink in NUD_PROBE
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

iproute2 arpd seems to expect this as there's code and comments
to handle netlink probes with NUD_PROBE set. It is used to flush
the arpd cached mappings.

opennhrp instead turns off unicast probes (so it can handle all
neighbour discovery). Without this change it will not see NUD_PROBE
probes and cannot reconfirm the mapping. Thus currently neigh entry
will just fail and can cause few packets dropped until broadcast
discovery is restarted.

Earlier discussion on the subject:
http://marc.info/?t=139305877100001&r=1&w=2

Signed-off-by: Timo Teräs <timo.teras@iki.fi>

Conflicts:
	net/core/neighbour.c
---
 net/core/neighbour.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index f73c2ce..46f8d28 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -834,9 +834,10 @@ out:
 static __inline__ int neigh_max_probes(struct neighbour *n)
 {
 	struct neigh_parms *p = n->parms;
-	return (n->nud_state & NUD_PROBE) ?
-		p->ucast_probes :
-		p->ucast_probes + p->app_probes + p->mcast_probes;
+	int max_probes = p->ucast_probes + p->app_probes;
+	if (!(n->nud_state & NUD_PROBE))
+		max_probes += p->mcast_probes;
+	return max_probes;
 }
 
 static void neigh_invalidate(struct neighbour *neigh)
-- 
1.9.0