aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2011-02-04 04:33:01 -0500
committerSimon Horman <horms@verge.net.au>2011-03-14 20:36:58 -0400
commit8e1b0b1b560019cafebe45a7d9e6ec1122fedc7b (patch)
treeea29fd7fa76cbbd2cea2ac2ec84b11afe2f20cfd /net
parent71a8ab6cad63b4816711f2ea518755677a870f6f (diff)
IPVS: Add expire_quiescent_template()
In preparation for not including sysctl_expire_quiescent_template in struct netns_ipvs when CONFIG_SYCTL is not defined. Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/ipvs/ip_vs_conn.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 9c2a517b69c8..f289306cbf12 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -680,6 +680,16 @@ static inline void ip_vs_unbind_dest(struct ip_vs_conn *cp)
680 atomic_dec(&dest->refcnt); 680 atomic_dec(&dest->refcnt);
681} 681}
682 682
683static int expire_quiescent_template(struct netns_ipvs *ipvs,
684 struct ip_vs_dest *dest)
685{
686#ifdef CONFIG_SYSCTL
687 return ipvs->sysctl_expire_quiescent_template &&
688 (atomic_read(&dest->weight) == 0);
689#else
690 return 0;
691#endif
692}
683 693
684/* 694/*
685 * Checking if the destination of a connection template is available. 695 * Checking if the destination of a connection template is available.
@@ -696,8 +706,7 @@ int ip_vs_check_template(struct ip_vs_conn *ct)
696 */ 706 */
697 if ((dest == NULL) || 707 if ((dest == NULL) ||
698 !(dest->flags & IP_VS_DEST_F_AVAILABLE) || 708 !(dest->flags & IP_VS_DEST_F_AVAILABLE) ||
699 (ipvs->sysctl_expire_quiescent_template && 709 expire_quiescent_template(ipvs, dest)) {
700 (atomic_read(&dest->weight) == 0))) {
701 IP_VS_DBG_BUF(9, "check_template: dest not available for " 710 IP_VS_DBG_BUF(9, "check_template: dest not available for "
702 "protocol %s s:%s:%d v:%s:%d " 711 "protocol %s s:%s:%d v:%s:%d "
703 "-> d:%s:%d\n", 712 "-> d:%s:%d\n",