diff mbox

netfilter: CT: improve error treatment

Message ID 1388653425-30466-1-git-send-email-eric@regit.org
State Accepted
Headers show

Commit Message

Eric Leblond Jan. 2, 2014, 9:03 a.m. UTC
If setting event mask fails then we were returning 0 for success.
This patch updates return code to -EINVAL in case of problem.

Signed-off-by: Eric Leblond <eric@regit.org>
---
 net/netfilter/xt_CT.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Pablo Neira Ayuso Jan. 3, 2014, 10:54 p.m. UTC | #1
On Thu, Jan 02, 2014 at 10:03:45AM +0100, Eric Leblond wrote:
> 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.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c
index da35ac0..5929be6 100644
--- a/net/netfilter/xt_CT.c
+++ b/net/netfilter/xt_CT.c
@@ -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);