mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 09:59:32 +00:00
ipvs: Pass ipvs not net to ip_vs_add_service
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
This commit is contained in:
parent
cd58278bd4
commit
5060bd8307
1 changed files with 4 additions and 5 deletions
|
@ -1157,14 +1157,13 @@ static void ip_vs_dest_trash_expire(unsigned long data)
|
|||
* Add a service into the service hash table
|
||||
*/
|
||||
static int
|
||||
ip_vs_add_service(struct net *net, struct ip_vs_service_user_kern *u,
|
||||
ip_vs_add_service(struct netns_ipvs *ipvs, struct ip_vs_service_user_kern *u,
|
||||
struct ip_vs_service **svc_p)
|
||||
{
|
||||
int ret = 0, i;
|
||||
struct ip_vs_scheduler *sched = NULL;
|
||||
struct ip_vs_pe *pe = NULL;
|
||||
struct ip_vs_service *svc = NULL;
|
||||
struct netns_ipvs *ipvs = net_ipvs(net);
|
||||
|
||||
/* increase the module use count */
|
||||
ip_vs_use_count_inc();
|
||||
|
@ -1255,7 +1254,7 @@ ip_vs_add_service(struct net *net, struct ip_vs_service_user_kern *u,
|
|||
else if (svc->port == 0)
|
||||
atomic_inc(&ipvs->nullsvc_counter);
|
||||
|
||||
ip_vs_start_estimator(net, &svc->stats);
|
||||
ip_vs_start_estimator(ipvs->net, &svc->stats);
|
||||
|
||||
/* Count only IPv4 services for old get/setsockopt interface */
|
||||
if (svc->af == AF_INET)
|
||||
|
@ -2421,7 +2420,7 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
|
|||
if (svc != NULL)
|
||||
ret = -EEXIST;
|
||||
else
|
||||
ret = ip_vs_add_service(net, &usvc, &svc);
|
||||
ret = ip_vs_add_service(ipvs, &usvc, &svc);
|
||||
break;
|
||||
case IP_VS_SO_SET_EDIT:
|
||||
ret = ip_vs_edit_service(svc, &usvc);
|
||||
|
@ -3601,7 +3600,7 @@ static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info)
|
|||
switch (cmd) {
|
||||
case IPVS_CMD_NEW_SERVICE:
|
||||
if (svc == NULL)
|
||||
ret = ip_vs_add_service(net, &usvc, &svc);
|
||||
ret = ip_vs_add_service(ipvs, &usvc, &svc);
|
||||
else
|
||||
ret = -EEXIST;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue