[{"id":1762337,"web_url":"http://patchwork.ozlabs.org/comment/1762337/","msgid":"<20170903223309.GA12383@salvia>","list_archive_url":null,"date":"2017-09-03T22:33:09","subject":"Re: [nft PATCH 1/2] src: add flags fo nft_ctx_new","submitter":{"id":1315,"url":"http://patchwork.ozlabs.org/api/people/1315/","name":"Pablo Neira Ayuso","email":"pablo@netfilter.org"},"content":"On Mon, Sep 04, 2017 at 12:03:55AM +0200, Eric Leblond wrote:\n> By adding flags to nft_ctx_new, we will have a minimum capabilities\n> of changing the way the nft_ctx is created.\n> \n> For now, this patch uses a simple value that allow the user to specify\n> that he will handle netlink by himself.\n> \n> Signed-off-by: Eric Leblond <eric@regit.org>\n> ---\n>  include/nftables.h |  4 ++++\n>  src/main.c         | 20 +++++++++++---------\n>  2 files changed, 15 insertions(+), 9 deletions(-)\n> \n> diff --git a/include/nftables.h b/include/nftables.h\n> index 5035567..7c4e93f 100644\n> --- a/include/nftables.h\n> +++ b/include/nftables.h\n> @@ -49,8 +49,12 @@ struct nft_ctx {\n>  \tstruct output_ctx\toutput;\n>  \tbool\t\t\tcheck;\n>  \tstruct nft_cache\tcache;\n> +\tuint32_t\t\tflags;\n>  };\n>  \n> +#define NFT_CTX_CUSTOM_NETLINK\t(1<<0)\n> +#define NFT_CTX_DEFAULT\t\t0\n\nBetter than flag, let's make this a type, ie. NFT_CTX_NETLINK is just 1.\n\nOK?\n--\nTo unsubscribe from this list: send the line \"unsubscribe netfilter-devel\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<netfilter-devel-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netfilter-devel-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xlnnf2Lm4z9s06\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon,  4 Sep 2017 08:33:42 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753070AbdICWdl (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tSun, 3 Sep 2017 18:33:41 -0400","from ganesha.gnumonks.org ([213.95.27.120]:40732 \"EHLO\n\tganesha.gnumonks.org\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752984AbdICWdl (ORCPT\n\t<rfc822;netfilter-devel@vger.kernel.org>);\n\tSun, 3 Sep 2017 18:33:41 -0400","from [31.4.193.113] (helo=gnumonks.org)\n\tby ganesha.gnumonks.org with esmtpsa\n\t(TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2)\n\t(envelope-from <pablo@gnumonks.org>)\n\tid 1dodS5-0001zt-2M; Mon, 04 Sep 2017 00:33:18 +0200"],"Date":"Mon, 4 Sep 2017 00:33:09 +0200","From":"Pablo Neira Ayuso <pablo@netfilter.org>","To":"Eric Leblond <eric@regit.org>","Cc":"netfilter-devel@vger.kernel.org","Subject":"Re: [nft PATCH 1/2] src: add flags fo nft_ctx_new","Message-ID":"<20170903223309.GA12383@salvia>","References":"<20170903220356.20178-1-eric@regit.org>\n\t<20170903220356.20178-2-eric@regit.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170903220356.20178-2-eric@regit.org>","User-Agent":"Mutt/1.5.23 (2014-03-12)","X-Spam-Score":"-2.9 (--)","Sender":"netfilter-devel-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netfilter-devel.vger.kernel.org>","X-Mailing-List":"netfilter-devel@vger.kernel.org"}},{"id":1762339,"web_url":"http://patchwork.ozlabs.org/comment/1762339/","msgid":"<20170903224544.GA13487@salvia>","list_archive_url":null,"date":"2017-09-03T22:45:44","subject":"Re: [nft PATCH 1/2] src: add flags fo nft_ctx_new","submitter":{"id":1315,"url":"http://patchwork.ozlabs.org/api/people/1315/","name":"Pablo Neira Ayuso","email":"pablo@netfilter.org"},"content":"On Mon, Sep 04, 2017 at 12:33:09AM +0200, Pablo Neira Ayuso wrote:\n> On Mon, Sep 04, 2017 at 12:03:55AM +0200, Eric Leblond wrote:\n> > By adding flags to nft_ctx_new, we will have a minimum capabilities\n> > of changing the way the nft_ctx is created.\n> > \n> > For now, this patch uses a simple value that allow the user to specify\n> > that he will handle netlink by himself.\n> > \n> > Signed-off-by: Eric Leblond <eric@regit.org>\n> > ---\n> >  include/nftables.h |  4 ++++\n> >  src/main.c         | 20 +++++++++++---------\n> >  2 files changed, 15 insertions(+), 9 deletions(-)\n> > \n> > diff --git a/include/nftables.h b/include/nftables.h\n> > index 5035567..7c4e93f 100644\n> > --- a/include/nftables.h\n> > +++ b/include/nftables.h\n> > @@ -49,8 +49,12 @@ struct nft_ctx {\n> >  \tstruct output_ctx\toutput;\n> >  \tbool\t\t\tcheck;\n> >  \tstruct nft_cache\tcache;\n> > +\tuint32_t\t\tflags;\n> >  };\n> >  \n> > +#define NFT_CTX_CUSTOM_NETLINK\t(1<<0)\n> > +#define NFT_CTX_DEFAULT\t\t0\n> \n> Better than flag, let's make this a type, ie. NFT_CTX_NETLINK is just 1.\n> \n> OK?\n\nActually, we keep this back, I mean, we just have NFT_CTX_DEFAULT, so\nwe don't introduce NFT_CTX_NETLINK until we have the advanced API in\nplace.\n\n--\nTo unsubscribe from this list: send the line \"unsubscribe netfilter-devel\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<netfilter-devel-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netfilter-devel-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xlp49039Jz9s06\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon,  4 Sep 2017 08:46:17 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753242AbdICWqQ (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tSun, 3 Sep 2017 18:46:16 -0400","from ganesha.gnumonks.org ([213.95.27.120]:40999 \"EHLO\n\tganesha.gnumonks.org\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1753097AbdICWqQ (ORCPT\n\t<rfc822;netfilter-devel@vger.kernel.org>);\n\tSun, 3 Sep 2017 18:46:16 -0400","from [31.4.193.113] (helo=gnumonks.org)\n\tby ganesha.gnumonks.org with esmtpsa\n\t(TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2)\n\t(envelope-from <pablo@gnumonks.org>)\n\tid 1dodeH-0002XM-2q; Mon, 04 Sep 2017 00:45:54 +0200"],"Date":"Mon, 4 Sep 2017 00:45:44 +0200","From":"Pablo Neira Ayuso <pablo@netfilter.org>","To":"Eric Leblond <eric@regit.org>","Cc":"netfilter-devel@vger.kernel.org","Subject":"Re: [nft PATCH 1/2] src: add flags fo nft_ctx_new","Message-ID":"<20170903224544.GA13487@salvia>","References":"<20170903220356.20178-1-eric@regit.org>\n\t<20170903220356.20178-2-eric@regit.org>\n\t<20170903223309.GA12383@salvia>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170903223309.GA12383@salvia>","User-Agent":"Mutt/1.5.23 (2014-03-12)","X-Spam-Score":"-2.9 (--)","Sender":"netfilter-devel-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netfilter-devel.vger.kernel.org>","X-Mailing-List":"netfilter-devel@vger.kernel.org"}},{"id":1762472,"web_url":"http://patchwork.ozlabs.org/comment/1762472/","msgid":"<1504509687.15611.16.camel@regit.org>","list_archive_url":null,"date":"2017-09-04T07:21:27","subject":"Re: [nft PATCH 1/2] src: add flags fo nft_ctx_new","submitter":{"id":8198,"url":"http://patchwork.ozlabs.org/api/people/8198/","name":"Eric Leblond","email":"eric@regit.org"},"content":"Hi,\n\nOn Mon, 2017-09-04 at 00:45 +0200, Pablo Neira Ayuso wrote:\n> On Mon, Sep 04, 2017 at 12:33:09AM +0200, Pablo Neira Ayuso wrote:\n> > On Mon, Sep 04, 2017 at 12:03:55AM +0200, Eric Leblond wrote:\n> > > By adding flags to nft_ctx_new, we will have a minimum\n> > > capabilities\n> > > of changing the way the nft_ctx is created.\n> > > \n> > > For now, this patch uses a simple value that allow the user to\n> > > specify\n> > > that he will handle netlink by himself.\n> > > \n> > > Signed-off-by: Eric Leblond <eric@regit.org>\n> > > ---\n> > >  include/nftables.h |  4 ++++\n> > >  src/main.c         | 20 +++++++++++---------\n> > >  2 files changed, 15 insertions(+), 9 deletions(-)\n> > > \n> > > diff --git a/include/nftables.h b/include/nftables.h\n> > > index 5035567..7c4e93f 100644\n> > > --- a/include/nftables.h\n> > > +++ b/include/nftables.h\n> > > @@ -49,8 +49,12 @@ struct nft_ctx {\n> > >  \tstruct output_ctx\toutput;\n> > >  \tbool\t\t\tcheck;\n> > >  \tstruct nft_cache\tcache;\n> > > +\tuint32_t\t\tflags;\n> > >  };\n> > >  \n> > > +#define NFT_CTX_CUSTOM_NETLINK\t(1<<0)\n> > > +#define NFT_CTX_DEFAULT\t\t0\n> > \n> > Better than flag, let's make this a type, ie. NFT_CTX_NETLINK is\n> > just 1.\n> > \n> > OK?\n> \n> Actually, we keep this back, I mean, we just have NFT_CTX_DEFAULT, so\n> we don't introduce NFT_CTX_NETLINK until we have the advanced API in\n> place.\n\nYes, make sense, it was a bit artificial. I will cook updated patch\ntoday.\n\nBR,","headers":{"Return-Path":"<netfilter-devel-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netfilter-devel-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xm1Vg5yvYz9ryr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon,  4 Sep 2017 17:21:31 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753259AbdIDHVa (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tMon, 4 Sep 2017 03:21:30 -0400","from home.regit.org ([37.187.126.138]:44988 \"EHLO home.regit.org\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751949AbdIDHVa (ORCPT <rfc822; netfilter-devel@vger.kernel.org>);\n\tMon, 4 Sep 2017 03:21:30 -0400","from [2a01:e35:2fb6:1160:f022:11:465e:d69b] (helo=ice-age2)\n\tby home.regit.org with esmtpsa\n\t(TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89)\n\t(envelope-from <eric@regit.org>)\n\tid 1dolhI-00049F-1g; Mon, 04 Sep 2017 09:21:28 +0200"],"Message-ID":"<1504509687.15611.16.camel@regit.org>","Subject":"Re: [nft PATCH 1/2] src: add flags fo nft_ctx_new","From":"Eric Leblond <eric@regit.org>","To":"Pablo Neira Ayuso <pablo@netfilter.org>","Cc":"netfilter-devel@vger.kernel.org","Date":"Mon, 04 Sep 2017 09:21:27 +0200","In-Reply-To":"<20170903224544.GA13487@salvia>","References":"<20170903220356.20178-1-eric@regit.org>\n\t<20170903220356.20178-2-eric@regit.org>\n\t<20170903223309.GA12383@salvia> <20170903224544.GA13487@salvia>","Organization":"INL","Content-Type":"text/plain; charset=\"ISO-8859-15\"","X-Mailer":"Evolution 3.22.6-1 ","Mime-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Spam-Score":"-1.0 (-)","Sender":"netfilter-devel-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netfilter-devel.vger.kernel.org>","X-Mailing-List":"netfilter-devel@vger.kernel.org"}}]