]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.8.5/ipv4-fix-definition-of-fib_table_hashsz.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 3.8.5 / ipv4-fix-definition-of-fib_table_hashsz.patch
CommitLineData
d6e9c606
GKH
1From 0e7e63e4b65a06692d85f68a4111f7610e184eba Mon Sep 17 00:00:00 2001
2From: "Denis V. Lunev" <den@openvz.org>
3Date: Wed, 13 Mar 2013 00:24:15 +0000
4Subject: ipv4: fix definition of FIB_TABLE_HASHSZ
5
6
7From: "Denis V. Lunev" <den@openvz.org>
8
9[ Upstream commit 5b9e12dbf92b441b37136ea71dac59f05f2673a9 ]
10
11a long time ago by the commit
12
13 commit 93456b6d7753def8760b423ac6b986eb9d5a4a95
14 Author: Denis V. Lunev <den@openvz.org>
15 Date: Thu Jan 10 03:23:38 2008 -0800
16
17 [IPV4]: Unify access to the routing tables.
18
19the defenition of FIB_HASH_TABLE size has obtained wrong dependency:
20it should depend upon CONFIG_IP_MULTIPLE_TABLES (as was in the original
21code) but it was depended from CONFIG_IP_ROUTE_MULTIPATH
22
23This patch returns the situation to the original state.
24
25The problem was spotted by Tingwei Liu.
26
27Signed-off-by: Denis V. Lunev <den@openvz.org>
28CC: Tingwei Liu <tingw.liu@gmail.com>
29CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
30Signed-off-by: David S. Miller <davem@davemloft.net>
31Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32---
33 include/net/ip_fib.h | 12 +++++-------
34 1 file changed, 5 insertions(+), 7 deletions(-)
35
36--- a/include/net/ip_fib.h
37+++ b/include/net/ip_fib.h
38@@ -152,18 +152,16 @@ struct fib_result_nl {
39 };
40
41 #ifdef CONFIG_IP_ROUTE_MULTIPATH
42-
43 #define FIB_RES_NH(res) ((res).fi->fib_nh[(res).nh_sel])
44-
45-#define FIB_TABLE_HASHSZ 2
46-
47 #else /* CONFIG_IP_ROUTE_MULTIPATH */
48-
49 #define FIB_RES_NH(res) ((res).fi->fib_nh[0])
50+#endif /* CONFIG_IP_ROUTE_MULTIPATH */
51
52+#ifdef CONFIG_IP_MULTIPLE_TABLES
53 #define FIB_TABLE_HASHSZ 256
54-
55-#endif /* CONFIG_IP_ROUTE_MULTIPATH */
56+#else
57+#define FIB_TABLE_HASHSZ 2
58+#endif
59
60 extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh);
61