]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
7a8a6ab785ed7b03d54ff3d7d72e476ac9064f6a
[thirdparty/kernel/stable-queue.git] /
1 From bd10a3abbed1d5542a0930dcdfc121973276275e Mon Sep 17 00:00:00 2001
2 From: Hannes Frederic Sowa <hannes@stressinduktion.org>
3 Date: Wed, 3 Jul 2013 20:45:04 +0200
4 Subject: ipv6: rt6_check_neigh should successfully verify neigh if no NUD information are available
5
6 From: Hannes Frederic Sowa <hannes@stressinduktion.org>
7
8 [ Upstream commit 3630d40067a21d4dfbadc6002bb469ce26ac5d52 ]
9
10 After the removal of rt->n we do not create a neighbour entry at route
11 insertion time (rt6_bind_neighbour is gone). As long as no neighbour is
12 created because of "useful traffic" we skip this routing entry because
13 rt6_check_neigh cannot pick up a valid neighbour (neigh == NULL) and
14 thus returns false.
15
16 This change was introduced by commit
17 887c95cc1da53f66a5890fdeab13414613010097 ("ipv6: Complete neighbour
18 entry removal from dst_entry.")
19
20 To quote RFC4191:
21 "If the host has no information about the router's reachability, then
22 the host assumes the router is reachable."
23
24 and also:
25 "A host MUST NOT probe a router's reachability in the absence of useful
26 traffic that the host would have sent to the router if it were reachable."
27
28 So, just assume the router is reachable and let's rt6_probe do the
29 rest. We don't need to create a neighbour on route insertion time.
30
31 If we don't compile with CONFIG_IPV6_ROUTER_PREF (RFC4191 support)
32 a neighbour is only valid if its nud_state is NUD_VALID. I did not find
33 any references that we should probe the router on route insertion time
34 via the other RFCs. So skip this route in that case.
35
36 v2:
37 a) use IS_ENABLED instead of #ifdefs (thanks to Sergei Shtylyov)
38
39 Reported-by: Pierre Emeriaud <petrus.lt@gmail.com>
40 Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
41 Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
42 Signed-off-by: David S. Miller <davem@davemloft.net>
43 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
44 ---
45 net/ipv6/route.c | 2 ++
46 1 file changed, 2 insertions(+)
47
48 --- a/net/ipv6/route.c
49 +++ b/net/ipv6/route.c
50 @@ -547,6 +547,8 @@ static inline bool rt6_check_neigh(struc
51 ret = true;
52 #endif
53 read_unlock(&neigh->lock);
54 + } else if (IS_ENABLED(CONFIG_IPV6_ROUTER_PREF)) {
55 + ret = true;
56 }
57 rcu_read_unlock_bh();
58