Skip to content

Commit 4b86c45

Browse files
Jarno Rajahalmeummakynes
authored andcommitted
netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value.
Commit 4dee62b ("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 <[email protected]> Acked-by: Joe Stringer <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 7fb668a commit 4b86c45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/netfilter/nf_conntrack_expect.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ static inline int __nf_ct_expect_check(struct nf_conntrack_expect *expect)
410410
struct net *net = nf_ct_exp_net(expect);
411411
struct hlist_node *next;
412412
unsigned int h;
413-
int ret = 1;
413+
int ret = 0;
414414

415415
if (!master_help) {
416416
ret = -ESHUTDOWN;
@@ -460,7 +460,7 @@ int nf_ct_expect_related_report(struct nf_conntrack_expect *expect,
460460

461461
spin_lock_bh(&nf_conntrack_expect_lock);
462462
ret = __nf_ct_expect_check(expect);
463-
if (ret <= 0)
463+
if (ret < 0)
464464
goto out;
465465

466466
nf_ct_expect_insert(expect);

0 commit comments

Comments
 (0)