diff options
author | 2011-02-04 18:33:01 +0900 | |
---|---|---|
committer | 2011-03-15 09:36:58 +0900 | |
commit | 8e1b0b1b560019cafebe45a7d9e6ec1122fedc7b (patch) | |
tree | ea29fd7fa76cbbd2cea2ac2ec84b11afe2f20cfd | |
parent | IPVS: Add sysctl_expire_nodest_conn() (diff) | |
download | linux-8e1b0b1b560019cafebe45a7d9e6ec1122fedc7b.tar.gz linux-8e1b0b1b560019cafebe45a7d9e6ec1122fedc7b.tar.bz2 linux-8e1b0b1b560019cafebe45a7d9e6ec1122fedc7b.zip |
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>
-rw-r--r-- | net/netfilter/ipvs/ip_vs_conn.c | 13 |
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) atomic_dec(&dest->refcnt); } +static int expire_quiescent_template(struct netns_ipvs *ipvs, + struct ip_vs_dest *dest) +{ +#ifdef CONFIG_SYSCTL + return ipvs->sysctl_expire_quiescent_template && + (atomic_read(&dest->weight) == 0); +#else + return 0; +#endif +} /* * Checking if the destination of a connection template is available. @@ -696,8 +706,7 @@ int ip_vs_check_template(struct ip_vs_conn *ct) */ if ((dest == NULL) || !(dest->flags & IP_VS_DEST_F_AVAILABLE) || - (ipvs->sysctl_expire_quiescent_template && - (atomic_read(&dest->weight) == 0))) { + expire_quiescent_template(ipvs, dest)) { IP_VS_DBG_BUF(9, "check_template: dest not available for " "protocol %s s:%s:%d v:%s:%d " "-> d:%s:%d\n", |