diff options
author | Sven Wegener <sven.wegener@stealer.net> | 2008-09-08 07:38:11 -0400 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2008-09-08 19:50:55 -0400 |
commit | 2206a3f5b75be5dadf11541961bd7c924857eb5d (patch) | |
tree | 8a77697bbd389f723cf7a5acce7303651e701b8c /include/net/ip_vs.h | |
parent | 9d7f2a2b1aa9e55537a053c68bdbd119fc479dd3 (diff) |
ipvs: Restrict connection table size via Kconfig
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>
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r-- | include/net/ip_vs.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 1b13cef4b547..38f4f690b186 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -621,16 +621,8 @@ extern void ip_vs_init_hash_table(struct list_head *table, int rows); | |||
621 | #ifndef CONFIG_IP_VS_TAB_BITS | 621 | #ifndef CONFIG_IP_VS_TAB_BITS |
622 | #define CONFIG_IP_VS_TAB_BITS 12 | 622 | #define CONFIG_IP_VS_TAB_BITS 12 |
623 | #endif | 623 | #endif |
624 | /* make sure that IP_VS_CONN_TAB_BITS is located in [8, 20] */ | 624 | |
625 | #if CONFIG_IP_VS_TAB_BITS < 8 | ||
626 | #define IP_VS_CONN_TAB_BITS 8 | ||
627 | #endif | ||
628 | #if CONFIG_IP_VS_TAB_BITS > 20 | ||
629 | #define IP_VS_CONN_TAB_BITS 20 | ||
630 | #endif | ||
631 | #if 8 <= CONFIG_IP_VS_TAB_BITS && CONFIG_IP_VS_TAB_BITS <= 20 | ||
632 | #define IP_VS_CONN_TAB_BITS CONFIG_IP_VS_TAB_BITS | 625 | #define IP_VS_CONN_TAB_BITS CONFIG_IP_VS_TAB_BITS |
633 | #endif | ||
634 | #define IP_VS_CONN_TAB_SIZE (1 << IP_VS_CONN_TAB_BITS) | 626 | #define IP_VS_CONN_TAB_SIZE (1 << IP_VS_CONN_TAB_BITS) |
635 | #define IP_VS_CONN_TAB_MASK (IP_VS_CONN_TAB_SIZE - 1) | 627 | #define IP_VS_CONN_TAB_MASK (IP_VS_CONN_TAB_SIZE - 1) |
636 | 628 | ||