netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf 1/2] netfilter: nf_ct_expect: nf_ct_expect_related_report(): Return zero on success.
@ 2017-02-24  1:08 Jarno Rajahalme
  2017-02-24  1:08 ` [PATCH nf 2/2] netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value Jarno Rajahalme
  2017-02-25 12:34 ` [PATCH nf 1/2] netfilter: nf_ct_expect: nf_ct_expect_related_report(): Return zero on success Pablo Neira Ayuso
  0 siblings, 2 replies; 4+ messages in thread
From: Jarno Rajahalme @ 2017-02-24  1:08 UTC (permalink / raw)
  To: netfilter-devel; +Cc: jarno, fgao, pablo

Commit 4dee62b1b9b4 ("netfilter: nf_ct_expect: nf_ct_expect_insert()
returns void") inadvertently changed the successful return value of
nf_ct_expect_related_report() from 0 to 1, which caused openvswitch
conntrack integration fail in FTP test cases.

Fix this by always returning zero on the success code path.

Fixes: 4dee62b1b9b4 ("netfilter: nf_ct_expect: nf_ct_expect_insert() returns void")
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
---
 net/netfilter/nf_conntrack_expect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index e19a697..d6ace69 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -467,7 +467,7 @@ int nf_ct_expect_related_report(struct nf_conntrack_expect *expect,
 
 	spin_unlock_bh(&nf_conntrack_expect_lock);
 	nf_ct_expect_event_report(IPEXP_NEW, expect, portid, report);
-	return ret;
+	return 0;
 out:
 	spin_unlock_bh(&nf_conntrack_expect_lock);
 	return ret;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH nf 2/2] netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value.
  2017-02-24  1:08 [PATCH nf 1/2] netfilter: nf_ct_expect: nf_ct_expect_related_report(): Return zero on success Jarno Rajahalme
@ 2017-02-24  1:08 ` Jarno Rajahalme
  2017-02-25 12:35   ` Pablo Neira Ayuso
  2017-02-25 12:34 ` [PATCH nf 1/2] netfilter: nf_ct_expect: nf_ct_expect_related_report(): Return zero on success Pablo Neira Ayuso
  1 sibling, 1 reply; 4+ messages in thread
From: Jarno Rajahalme @ 2017-02-24  1:08 UTC (permalink / raw)
  To: netfilter-devel; +Cc: jarno, fgao, pablo

Commit 4dee62b1b9b4 ("netfilter: nf_ct_expect: nf_ct_expect_insert()
returns void") inadvertently changed the successful return value of
nf_ct_expect_related_report() from 0 to 1 due to
__nf_ct_expect_check() returning 1 on success.  Prevent this
regression in the future by changing the return value of
__nf_ct_expect_check() to 0 on success.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
---
 net/netfilter/nf_conntrack_expect.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index d6ace69..4b2e1fb 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -410,7 +410,7 @@ static inline int __nf_ct_expect_check(struct nf_conntrack_expect *expect)
 	struct net *net = nf_ct_exp_net(expect);
 	struct hlist_node *next;
 	unsigned int h;
-	int ret = 1;
+	int ret = 0;
 
 	if (!master_help) {
 		ret = -ESHUTDOWN;
@@ -460,7 +460,7 @@ int nf_ct_expect_related_report(struct nf_conntrack_expect *expect,
 
 	spin_lock_bh(&nf_conntrack_expect_lock);
 	ret = __nf_ct_expect_check(expect);
-	if (ret <= 0)
+	if (ret < 0)
 		goto out;
 
 	nf_ct_expect_insert(expect);
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH nf 1/2] netfilter: nf_ct_expect: nf_ct_expect_related_report(): Return zero on success.
  2017-02-24  1:08 [PATCH nf 1/2] netfilter: nf_ct_expect: nf_ct_expect_related_report(): Return zero on success Jarno Rajahalme
  2017-02-24  1:08 ` [PATCH nf 2/2] netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value Jarno Rajahalme
@ 2017-02-25 12:34 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2017-02-25 12:34 UTC (permalink / raw)
  To: Jarno Rajahalme; +Cc: netfilter-devel, fgao

On Thu, Feb 23, 2017 at 05:08:53PM -0800, Jarno Rajahalme wrote:
> Commit 4dee62b1b9b4 ("netfilter: nf_ct_expect: nf_ct_expect_insert()
> returns void") inadvertently changed the successful return value of
> nf_ct_expect_related_report() from 0 to 1, which caused openvswitch
> conntrack integration fail in FTP test cases.
> 
> Fix this by always returning zero on the success code path.

Applied, thanks Jarno.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH nf 2/2] netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value.
  2017-02-24  1:08 ` [PATCH nf 2/2] netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value Jarno Rajahalme
@ 2017-02-25 12:35   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2017-02-25 12:35 UTC (permalink / raw)
  To: Jarno Rajahalme; +Cc: netfilter-devel, fgao

On Thu, Feb 23, 2017 at 05:08:54PM -0800, Jarno Rajahalme wrote:
> Commit 4dee62b1b9b4 ("netfilter: nf_ct_expect: nf_ct_expect_insert()
> returns void") inadvertently changed the successful return value of
> nf_ct_expect_related_report() from 0 to 1 due to
> __nf_ct_expect_check() returning 1 on success.  Prevent this
> regression in the future by changing the return value of
> __nf_ct_expect_check() to 0 on success.

We used to return 0 via __nf_ct_expect_check() in the past, not
anymore for a while. So even if this doesn't fix anything, I'm fine
with this change to prevent more sloppy updates on this code.

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-25 12:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-24  1:08 [PATCH nf 1/2] netfilter: nf_ct_expect: nf_ct_expect_related_report(): Return zero on success Jarno Rajahalme
2017-02-24  1:08 ` [PATCH nf 2/2] netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value Jarno Rajahalme
2017-02-25 12:35   ` Pablo Neira Ayuso
2017-02-25 12:34 ` [PATCH nf 1/2] netfilter: nf_ct_expect: nf_ct_expect_related_report(): Return zero on success Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).