Skip to contentSkip to conversation

netfilter: CT: improve error treatment

PATCH Applied Eric Leblond 2 participants 2 messages Jan 2, 2014 – Jan 3, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: CT: improve error treatment

If setting event mask fails then we were returning 0 for success. This patch updates return code to -EINVAL in case of problem.

---
 net/netfilter/xt_CT.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/netfilter/xt_CT.c +3 -1
index da35ac0..5929be6 100644
@@ -211,8 +211,10 @@ static int xt_ct_tg_check(const struct xt_tgchk_param *par,
 	ret = 0;
 	if ((info->ct_events || info->exp_events) &&
 	    !nf_ct_ecache_ext_add(ct, info->ct_events, info->exp_events,
-				  GFP_KERNEL))
+				  GFP_KERNEL)) {
+		ret = -EINVAL;
 		goto err3;
+	}
 
 	if (info->helper[0]) {
 		ret = xt_ct_set_helper(ct, info->helper, par);
Signature · 1 line
1.8.5.2
maintainer Applied
#1 lore raw
Quoted 2 lines · Eric Leblond

If setting event mask fails then we were returning 0 for success. This patch updates return code to -EINVAL in case of problem.

Applied to nf-next, thanks Eric.