netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: gfree.wind@foxmail.com
Cc: netfilter-devel@vger.kernel.org, Gao Feng <fgao@ikuai8.com>
Subject: Re: [PATCH nf-next 1/1] netfilter: cttimeout: Refine cttimeout_del_timeout
Date: Fri, 14 Apr 2017 00:58:32 +0200	[thread overview]
Message-ID: <20170413225832.GA5541@salvia> (raw)
In-Reply-To: <1491564336-44483-1-git-send-email-gfree.wind@foxmail.com>

On Fri, Apr 07, 2017 at 07:25:36PM +0800, gfree.wind@foxmail.com wrote:
> From: Gao Feng <fgao@ikuai8.com>
> 
> 1. Return one error when try to delete all timeouts and meet one erorr;
> 2. Delete the condition block when fail to delete specified timeout.
> It is more clear that it would stop the loop when find one matched timeout.
> 
> Signed-off-by: Gao Feng <fgao@ikuai8.com>
> ---
>  net/netfilter/nfnetlink_cttimeout.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/net/netfilter/nfnetlink_cttimeout.c b/net/netfilter/nfnetlink_cttimeout.c
> index baa75f3..220847a 100644
> --- a/net/netfilter/nfnetlink_cttimeout.c
> +++ b/net/netfilter/nfnetlink_cttimeout.c
> @@ -361,11 +361,17 @@ static int cttimeout_del_timeout(struct net *net, struct sock *ctnl,
>  	char *name;
>  
>  	if (!cda[CTA_TIMEOUT_NAME]) {
> +		int cur_ret;
> +
> +		ret = 0;
>  		list_for_each_entry_safe(cur, tmp, &net->nfct_timeout_list,
> -					 head)
> -			ctnl_timeout_try_del(net, cur);

This code ignores ctnl_timeout_try_del() on purpose, to implement the
flush operation.

      reply	other threads:[~2017-04-13 22:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07 11:25 [PATCH nf-next 1/1] netfilter: cttimeout: Refine cttimeout_del_timeout gfree.wind
2017-04-13 22:58 ` Pablo Neira Ayuso [this message]

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=20170413225832.GA5541@salvia \
    --to=pablo@netfilter.org \
    --cc=fgao@ikuai8.com \
    --cc=gfree.wind@foxmail.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).