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:
Eric W. Biederman 2015-09-21 13:01:56 -05:00 committed by Simon Horman
parent cd58278bd4
commit 5060bd8307
1 changed files with 4 additions and 5 deletions

View File

@ -1157,14 +1157,13 @@ static void ip_vs_dest_trash_expire(unsigned long data)
* Add a service into the service hash table * Add a service into the service hash table
*/ */
static int 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) struct ip_vs_service **svc_p)
{ {
int ret = 0, i; int ret = 0, i;
struct ip_vs_scheduler *sched = NULL; struct ip_vs_scheduler *sched = NULL;
struct ip_vs_pe *pe = NULL; struct ip_vs_pe *pe = NULL;
struct ip_vs_service *svc = NULL; struct ip_vs_service *svc = NULL;
struct netns_ipvs *ipvs = net_ipvs(net);
/* increase the module use count */ /* increase the module use count */
ip_vs_use_count_inc(); 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) else if (svc->port == 0)
atomic_inc(&ipvs->nullsvc_counter); 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 */ /* Count only IPv4 services for old get/setsockopt interface */
if (svc->af == AF_INET) 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) if (svc != NULL)
ret = -EEXIST; ret = -EEXIST;
else else
ret = ip_vs_add_service(net, &usvc, &svc); ret = ip_vs_add_service(ipvs, &usvc, &svc);
break; break;
case IP_VS_SO_SET_EDIT: case IP_VS_SO_SET_EDIT:
ret = ip_vs_edit_service(svc, &usvc); 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) { switch (cmd) {
case IPVS_CMD_NEW_SERVICE: case IPVS_CMD_NEW_SERVICE:
if (svc == NULL) if (svc == NULL)
ret = ip_vs_add_service(net, &usvc, &svc); ret = ip_vs_add_service(ipvs, &usvc, &svc);
else else
ret = -EEXIST; ret = -EEXIST;
break; break;