Skip to content

Commit

Permalink
Merge tag 'ipvs2-for-v4.12' of https://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/horms/ipvs-next

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: Pablo Neira Ayuso <[email protected]>

Conflicts:
	net/netfilter/ipvs/ip_vs_ftp.c
  • Loading branch information
ummakynes committed Apr 15, 2017
2 parents db268d4 + e241137 commit a702ece
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions net/netfilter/ipvs/ip_vs_ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
buf_len = strlen(buf);

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;

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

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 */
return rv;
return register_pernet_subsys(&ip_vs_ftp_ops);
}

/*
Expand Down
4 changes: 2 additions & 2 deletions net/netfilter/ipvs/ip_vs_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c,
if (state == IP_VS_STATE_MASTER) {
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)
goto out;
ms = ipvs->ms;
Expand All @@ -1862,7 +1862,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c,
ms->ipvs = ipvs;
}
} else {
array = kzalloc(count * sizeof(struct task_struct *),
array = kcalloc(count, sizeof(struct task_struct *),
GFP_KERNEL);
if (!array)
goto out;
Expand Down

0 comments on commit a702ece

Please sign in to comment.