Re: [PATCH nf-next 1/1] netfilter: cttimeout: Refine cttimeout_del_timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 07, 2017 at 07:25:36PM +0800, gfree.wind@xxxxxxxxxxx wrote:
> From: Gao Feng <fgao@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> ---
>  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.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux