From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Subject: Re: [PATCH 33/34] netfilter: nf_tables: store and dump set policy Date: Mon, 29 Sep 2014 20:14:59 +0400 Message-ID: <54298583.3020100@cogentembedded.com> References: <1411994363-8451-1-git-send-email-pablo@netfilter.org> <1411994363-8451-34-git-send-email-pablo@netfilter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: davem@davemloft.net, netdev@vger.kernel.org To: Pablo Neira Ayuso , netfilter-devel@vger.kernel.org Return-path: Received: from mail-la0-f52.google.com ([209.85.215.52]:65305 "EHLO mail-la0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754319AbaI2QPD (ORCPT ); Mon, 29 Sep 2014 12:15:03 -0400 Received: by mail-la0-f52.google.com with SMTP id hz20so1804317lab.39 for ; Mon, 29 Sep 2014 09:15:02 -0700 (PDT) In-Reply-To: <1411994363-8451-34-git-send-email-pablo@netfilter.org> Sender: netfilter-devel-owner@vger.kernel.org List-ID: On 09/29/2014 04:39 PM, Pablo Neira Ayuso wrote: > From: Arturo Borrero > We want to know in which cases the user explicitly sets the policy > options. In that case, we also want to dump back the info. > Signed-off-by: Arturo Borrero Gonzalez > Signed-off-by: Pablo Neira Ayuso > --- > include/net/netfilter/nf_tables.h | 2 ++ > net/netfilter/nf_tables_api.c | 6 ++++++ > 2 files changed, 8 insertions(+) > diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h > index c4d8619..3d72923 100644 > --- a/include/net/netfilter/nf_tables.h > +++ b/include/net/netfilter/nf_tables.h [...] > index a476b99..19e79f0 100644 > --- a/net/netfilter/nf_tables_api.c > +++ b/net/netfilter/nf_tables_api.c > @@ -2344,6 +2344,11 @@ static int nf_tables_fill_set(struct sk_buff *skb, const struct nft_ctx *ctx, > goto nla_put_failure; > } > > + if (set->policy != NFT_SET_POL_PERFORMANCE) { > + if (nla_put_be32(skb, NFTA_SET_POLICY, htonl(set->policy))) > + goto nla_put_failure; Why not fold these two *if* stetement into a single one? WBR, Sergei