Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a702ece3 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso
Browse files


Simon Horman says:

====================
Second Round of IPVS Updates for v4.12

please consider these clean-ups and enhancements to IPVS for v4.12.

* Removal unused variable
* Use kzalloc where appropriate
* More efficient detection of presence of NAT extension
====================

Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>

Conflicts:
	net/netfilter/ipvs/ip_vs_ftp.c
parents db268d4d e2411376
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -260,7 +260,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
		buf_len = strlen(buf);
		buf_len = strlen(buf);


		ct = nf_ct_get(skb, &ctinfo);
		ct = nf_ct_get(skb, &ctinfo);
		if (ct && !nf_ct_is_untracked(ct) && nfct_nat(ct)) {
		if (ct && !nf_ct_is_untracked(ct) && (ct->status & IPS_NAT_MASK)) {
			bool mangled;
			bool mangled;


			/* If mangling fails this function will return 0
			/* If mangling fails this function will return 0
@@ -485,11 +485,8 @@ static struct pernet_operations ip_vs_ftp_ops = {


static int __init ip_vs_ftp_init(void)
static int __init ip_vs_ftp_init(void)
{
{
	int rv;

	rv = register_pernet_subsys(&ip_vs_ftp_ops);
	/* rcu_barrier() is called by netns on error */
	/* rcu_barrier() is called by netns on error */
	return rv;
	return register_pernet_subsys(&ip_vs_ftp_ops);
}
}


/*
/*
+2 −2
Original line number Original line Diff line number Diff line
@@ -1849,7 +1849,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c,
	if (state == IP_VS_STATE_MASTER) {
	if (state == IP_VS_STATE_MASTER) {
		struct ipvs_master_sync_state *ms;
		struct ipvs_master_sync_state *ms;


		ipvs->ms = kzalloc(count * sizeof(ipvs->ms[0]), GFP_KERNEL);
		ipvs->ms = kcalloc(count, sizeof(ipvs->ms[0]), GFP_KERNEL);
		if (!ipvs->ms)
		if (!ipvs->ms)
			goto out;
			goto out;
		ms = ipvs->ms;
		ms = ipvs->ms;
@@ -1862,7 +1862,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c,
			ms->ipvs = ipvs;
			ms->ipvs = ipvs;
		}
		}
	} else {
	} else {
		array = kzalloc(count * sizeof(struct task_struct *),
		array = kcalloc(count, sizeof(struct task_struct *),
				GFP_KERNEL);
				GFP_KERNEL);
		if (!array)
		if (!array)
			goto out;
			goto out;