netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liping Zhang <zlpnobody@gmail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Netfilter Developer Mailing List
	<netfilter-devel@vger.kernel.org>,
	jeffy.chen@rock-chips.com, briannorris@chromium.org,
	dianders@chromium.org
Subject: Re: [PATCH nf 1/2,v3] netfilter: nfnetlink_cthelper: fix runtime expectation policy updates
Date: Wed, 22 Mar 2017 13:38:08 +0800	[thread overview]
Message-ID: <CAML_gOfHxD6ScxARXJBMtE0SvVDioKBUvipY9Hyk8hLQt0edqw@mail.gmail.com> (raw)
In-Reply-To: <1490108275-19537-1-git-send-email-pablo@netfilter.org>

Hi Pablo,

2017-03-21 22:57 GMT+08:00 Pablo Neira Ayuso <pablo@netfilter.org>:
> We only allow runtime updates of expectation policies for timeout and
> maximum number of expectations, otherwise reject the update.
>
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> ---
> v3: Fixed expect_class_max semantics. Compile-tested only.

Acked-by: Liping Zhang <zlpnobody@gmail.com>

[...]
> +       /* Check first that all policy attributes are well-formed, so we don't
> +        * leave things in inconsistent state on errors.
> +        */

Good point, I missed this possible error scenario in my original patch 4/5.

> +       for (i = 0; i < helper->expect_class_max + 1; i++) {
> +
> +               if (!tb[NFCTH_POLICY_SET + i])
> +                       return -EINVAL;
> +
> +               err = nfnl_cthelper_update_policy_one(&helper->expect_policy[i],
> +                                                     &new_policy[i],
> +                                                     tb[NFCTH_POLICY_SET + i]);
> +               if (err < 0)
> +                       return err;
> +       }
> +       /* Now we can safely update them. */

  reply	other threads:[~2017-03-22  5:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 14:57 [PATCH nf 1/2,v3] netfilter: nfnetlink_cthelper: fix runtime expectation policy updates Pablo Neira Ayuso
2017-03-22  5:38 ` Liping Zhang [this message]
2017-03-22 12:04   ` 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=CAML_gOfHxD6ScxARXJBMtE0SvVDioKBUvipY9Hyk8hLQt0edqw@mail.gmail.com \
    --to=zlpnobody@gmail.com \
    --cc=briannorris@chromium.org \
    --cc=dianders@chromium.org \
    --cc=jeffy.chen@rock-chips.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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).