]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ipvs: Restrict connection table size via Kconfig
authorSven Wegener <sven.wegener@stealer.net>
Mon, 8 Sep 2008 11:38:11 +0000 (13:38 +0200)
committerSimon Horman <horms@verge.net.au>
Mon, 8 Sep 2008 23:50:55 +0000 (09:50 +1000)
Instead of checking the value in include/net/ip_vs.h, we can just
restrict the range in our Kconfig file. This will prevent values outside
of the range early.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Reviewed-by: Julius Volz <juliusv@google.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
include/net/ip_vs.h
net/ipv4/ipvs/Kconfig

index 1b13cef4b547ee2f54b2993679fe6537bacfcb33..38f4f690b186e9b8cbeacb43c20f1a97a0a9678b 100644 (file)
@@ -621,16 +621,8 @@ extern void ip_vs_init_hash_table(struct list_head *table, int rows);
 #ifndef CONFIG_IP_VS_TAB_BITS
 #define CONFIG_IP_VS_TAB_BITS   12
 #endif
-/* make sure that IP_VS_CONN_TAB_BITS is located in [8, 20] */
-#if CONFIG_IP_VS_TAB_BITS < 8
-#define IP_VS_CONN_TAB_BITS    8
-#endif
-#if CONFIG_IP_VS_TAB_BITS > 20
-#define IP_VS_CONN_TAB_BITS    20
-#endif
-#if 8 <= CONFIG_IP_VS_TAB_BITS && CONFIG_IP_VS_TAB_BITS <= 20
+
 #define IP_VS_CONN_TAB_BITS    CONFIG_IP_VS_TAB_BITS
-#endif
 #define IP_VS_CONN_TAB_SIZE     (1 << IP_VS_CONN_TAB_BITS)
 #define IP_VS_CONN_TAB_MASK     (IP_VS_CONN_TAB_SIZE - 1)
 
index 794cecb249aff006d267695e881b6faa13a8810c..de6004de80bcb4b72506c5409e0744b9544c9b84 100644 (file)
@@ -41,7 +41,8 @@ config        IP_VS_DEBUG
 
 config IP_VS_TAB_BITS
        int "IPVS connection table size (the Nth power of 2)"
-       default "12" 
+       range 8 20
+       default 12
        ---help---
          The IPVS connection hash table uses the chaining scheme to handle
          hash collisions. Using a big IPVS connection hash table will greatly