netfilter: nf_ct_expect: nf_ct_expect_related_report(): Return zero on success.
Subsystems (2)
PATCH 1/2 netfilter: nf_ct_expect: nf_ct_expect_related_report(): Return zero on success.
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.
--- net/netfilter/nf_conntrack_expect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_conntrack_expect.c +1 -1
@@ -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;
Signature · 1 line
2.1.4
PATCH 2/2 netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value.
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.
--- net/netfilter/nf_conntrack_expect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nf_conntrack_expect.c +2 -2
@@ -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);
Signature · 1 line
2.1.4
Re: [PATCH nf 2/2] netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value.
Quoted 6 lines · Jarno Rajahalme
Commit
4dee62b1b9b4("netfilter:nf_ct_expect:nf_ct_expect_insert()returns void") inadvertently changed the successful return value ofnf_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.
Quoted 6 lines · Jarno Rajahalme
Commit
4dee62b1b9b4("netfilter:nf_ct_expect:nf_ct_expect_insert()returns void") inadvertently changed the successful return value ofnf_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.