From: Pablo Neira Ayuso <pablo@netfilter.org>
To: "Carlos Falgueras García" <carlosfg@riseup.net>
Cc: Netfilter Development Mailing list <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH 3/3 v2] nftables: rule: Change the field "rule->comment" for an nftnl_attrbuf.
Date: Tue, 8 Mar 2016 11:13:06 +0100 [thread overview]
Message-ID: <20160308101306.GC3390@salvia> (raw)
In-Reply-To: <56DEA23B.80302@riseup.net>
On Tue, Mar 08, 2016 at 10:58:19AM +0100, Carlos Falgueras García wrote:
> On 02/03/16 19:37, Pablo Neira Ayuso wrote:
> >On Mon, Feb 29, 2016 at 05:25:40PM +0100, Carlos Falgueras García wrote:
> >>diff --git a/src/rule.c b/src/rule.c
> >>index 18ff592..499fa7b 100644
> >>--- a/src/rule.c
> >>+++ b/src/rule.c
> >>@@ -23,6 +23,7 @@
> >>
> >> #include <libnftnl/common.h>
> >> #include <libnftnl/ruleset.h>
> >>+#include <libnftnl/attr.h>
> >> #include <netinet/ip.h>
> >> #include <linux/netfilter.h>
> >> #include <linux/netfilter_arp.h>
> >>@@ -366,6 +367,7 @@ struct rule *rule_alloc(const struct location *loc, const struct handle *h)
> >> rule->location = *loc;
> >> init_list_head(&rule->list);
> >> init_list_head(&rule->stmts);
> >>+ rule->udata = NULL;
> >> if (h != NULL)
> >> rule->handle = *h;
> >> return rule;
> >>@@ -375,21 +377,53 @@ void rule_free(struct rule *rule)
> >> {
> >> stmt_list_free(&rule->stmts);
> >> handle_free(&rule->handle);
> >>- xfree(rule->comment);
> >>+ nftnl_attrbuf_free(rule->udata);
> >
> >I would rename this function to:
> >
> > nftnl_udata_free();
> >
> >So all functions that now refer to nftnl_attrbuf_* look like:
> >
> > nftnl_udata_*()
> >
> >then, to push/retrieve attributes, I would use the prefix:
> >
> > nftnl_udata_attr_*()
>
> I renamed all functions following these rule except "nftnl_udata_attr_put"
> which I changed to "nftnl_udata_put" because functions like
> "nftnl_udata_attr_put_strz" would have very long name. It is ok?
Yes, that's a good idea :)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-03-08 10:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-29 16:25 [PATCH 1/3 v2] libnftnl: Implement new buffer of TLV objects Carlos Falgueras García
2016-02-29 16:25 ` [PATCH 2/3 v2] libnftnl: rule: Change the "userdata" attribute to use new TLV buffer Carlos Falgueras García
2016-03-02 18:41 ` Pablo Neira Ayuso
2016-03-08 9:58 ` Carlos Falgueras García
2016-03-08 10:12 ` Pablo Neira Ayuso
2016-02-29 16:25 ` [PATCH 3/3 v2] nftables: rule: Change the field "rule->comment" for an nftnl_attrbuf Carlos Falgueras García
2016-03-02 18:37 ` Pablo Neira Ayuso
2016-03-08 9:58 ` Carlos Falgueras García
2016-03-08 10:13 ` Pablo Neira Ayuso [this message]
2016-03-02 18:32 ` [PATCH 1/3 v2] libnftnl: Implement new buffer of TLV objects Pablo Neira Ayuso
2016-03-08 9:57 ` Carlos Falgueras García
2016-03-08 10:10 ` 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=20160308101306.GC3390@salvia \
--to=pablo@netfilter.org \
--cc=carlosfg@riseup.net \
--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).