netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: xiao ruizhu <katrina.xiaorz@gmail.com>
Cc: kadlec@blackhole.kfki.hu, fw@strlen.de, davem@davemloft.net,
	alin.nastac@gmail.com, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH v5] netfilter: nf_conntrack_sip: fix expectation clash
Date: Mon, 10 Jun 2019 19:45:43 +0200	[thread overview]
Message-ID: <20190610174543.chflcq4udmpqitnu@salvia> (raw)
In-Reply-To: <1559637263-2679-1-git-send-email-katrina.xiaorz@gmail.com>

Looks good, only one more little change and we go.

On Tue, Jun 04, 2019 at 04:34:23PM +0800, xiao ruizhu wrote:
[...]
> @@ -420,8 +421,10 @@ static inline int __nf_ct_expect_check(struct nf_conntrack_expect *expect)
>  	}
>  	h = nf_ct_expect_dst_hash(net, &expect->tuple);
>  	hlist_for_each_entry_safe(i, next, &nf_ct_expect_hash[h], hnode) {
> -		if (expect_matches(i, expect)) {
> -			if (i->class != expect->class)
> +		if ((flags & NF_CT_EXP_F_CHECK_MASTER ? true : i->master ==
> +		    expect->master) && expect_matches(i, expect)) {

Could you add a function for this? eg.

static bool nf_ct_check_master(struct nf_conntrack_expect *a,
                               struct nf_conntrack_expect *b)
{
        if (flags & NF_CT_EXP_F_CHECK_MASTER)
                return true;

        return i->master == expect->master &&
               expect_matches(i, expect);
}

Was that the intention?

I'm a bit confused with the use of the single statement branch above.

Thanks!

> +			if (i->class != expect->class ||
> +			    i->master != expect->master)
>  				return -EALREADY;
>  
>  			if (nf_ct_remove_expect(i))

  reply	other threads:[~2019-06-10 17:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14  3:28 [PATCH v2] netfilter: nf_conntrack_sip: fix rtcp expectation clash xiao ruizhu
2019-03-14  8:21 ` Alin Năstac
2019-03-21 10:56 ` Pablo Neira Ayuso
2019-04-15  8:33   ` [PATCH v3] netfilter: nf_conntrack_sip: fix " xiao ruizhu
2019-05-13 11:26     ` Pablo Neira Ayuso
     [not found]       ` <CAEorUYZe2mtLupMDkAOvMXZoH_NcUOKLR=K4atLC5dddHOs-MQ@mail.gmail.com>
2019-05-14 10:18         ` Pablo Neira Ayuso
2019-05-15  7:45           ` [PATCH v4] " xiao ruizhu
2019-06-04  8:34           ` [PATCH v5] " xiao ruizhu
2019-06-10 17:45             ` Pablo Neira Ayuso [this message]
2019-06-11  5:20               ` [PATCH v6] " xiao ruizhu
2019-06-17 22:37                 ` Pablo Neira Ayuso
2019-06-18  8:32                   ` [PATCH v7] " xiao ruizhu
2019-07-02 23:51                     ` Pablo Neira Ayuso
2019-07-04  3:31                       ` [PATCH v8] " xiao ruizhu
2019-07-16 11:17                         ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190610174543.chflcq4udmpqitnu@salvia \
    --to=pablo@netfilter.org \
    --cc=alin.nastac@gmail.com \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=katrina.xiaorz@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).