Commit 754b81a3 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Simon Horman

ipvs: Pass ipvs not net to ip_vs_conn_hashkey

Use the address of struct netns_ipvs in the hash not the address of
struct net.  Both addresses are equally valid candidates and by using
the address of struct netns_ipvs there becomes no need deal with
struct net in this part of the code.
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent 0cf705c8
...@@ -108,7 +108,7 @@ static inline void ct_write_unlock_bh(unsigned int key) ...@@ -108,7 +108,7 @@ static inline void ct_write_unlock_bh(unsigned int key)
/* /*
* Returns hash value for IPVS connection entry * Returns hash value for IPVS connection entry
*/ */
static unsigned int ip_vs_conn_hashkey(struct net *net, int af, unsigned int proto, static unsigned int ip_vs_conn_hashkey(struct netns_ipvs *ipvs, int af, unsigned int proto,
const union nf_inet_addr *addr, const union nf_inet_addr *addr,
__be16 port) __be16 port)
{ {
...@@ -116,11 +116,11 @@ static unsigned int ip_vs_conn_hashkey(struct net *net, int af, unsigned int pro ...@@ -116,11 +116,11 @@ static unsigned int ip_vs_conn_hashkey(struct net *net, int af, unsigned int pro
if (af == AF_INET6) if (af == AF_INET6)
return (jhash_3words(jhash(addr, 16, ip_vs_conn_rnd), return (jhash_3words(jhash(addr, 16, ip_vs_conn_rnd),
(__force u32)port, proto, ip_vs_conn_rnd) ^ (__force u32)port, proto, ip_vs_conn_rnd) ^
((size_t)net>>8)) & ip_vs_conn_tab_mask; ((size_t)ipvs>>8)) & ip_vs_conn_tab_mask;
#endif #endif
return (jhash_3words((__force u32)addr->ip, (__force u32)port, proto, return (jhash_3words((__force u32)addr->ip, (__force u32)port, proto,
ip_vs_conn_rnd) ^ ip_vs_conn_rnd) ^
((size_t)net>>8)) & ip_vs_conn_tab_mask; ((size_t)ipvs>>8)) & ip_vs_conn_tab_mask;
} }
static unsigned int ip_vs_conn_hashkey_param(const struct ip_vs_conn_param *p, static unsigned int ip_vs_conn_hashkey_param(const struct ip_vs_conn_param *p,
...@@ -141,7 +141,7 @@ static unsigned int ip_vs_conn_hashkey_param(const struct ip_vs_conn_param *p, ...@@ -141,7 +141,7 @@ static unsigned int ip_vs_conn_hashkey_param(const struct ip_vs_conn_param *p,
port = p->vport; port = p->vport;
} }
return ip_vs_conn_hashkey(p->ipvs->net, p->af, p->protocol, addr, port); return ip_vs_conn_hashkey(p->ipvs, p->af, p->protocol, addr, port);
} }
static unsigned int ip_vs_conn_hashkey_conn(const struct ip_vs_conn *cp) static unsigned int ip_vs_conn_hashkey_conn(const struct ip_vs_conn *cp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment