From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Ken-ichirou MATSUZAWA <chamaken@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH RFC 1/3] netfilter: ctnetlink: remove ctnetlink_nfqueue_build_size()
Date: Thu, 10 Sep 2015 02:12:17 +0200 [thread overview]
Message-ID: <20150910001217.GD5734@salvia> (raw)
In-Reply-To: <20150909095321.GB11843@gmail.com>
On Wed, Sep 09, 2015 at 06:53:21PM +0900, Ken-ichirou MATSUZAWA wrote:
> On Tue, Sep 08, 2015 at 06:54:49PM +0200, Pablo Neira Ayuso wrote:
> [...]
> > diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
> > index 94a6654..5fd3d48 100644
> > --- a/net/netfilter/nf_conntrack_netlink.c
> > +++ b/net/netfilter/nf_conntrack_netlink.c
> > @@ -596,11 +596,9 @@ ctnetlink_timestamp_size(const struct nf_conn *ct)
> > #endif
> > }
> >
> > -static inline size_t
> > -ctnetlink_nlmsg_size(const struct nf_conn *ct)
> > +static size_t ctnetlink_nlmsg_payload_size(const struct nf_conn *ct)
> > {
> > - return NLMSG_ALIGN(sizeof(struct nfgenmsg))
> > - + 3 * nla_total_size(0) /* CTA_TUPLE_ORIG|REPL|MASTER */
> > + return 3 * nla_total_size(0) /* CTA_TUPLE_ORIG|REPL|MASTER */
> > + 3 * nla_total_size(0) /* CTA_TUPLE_IP */
> > + 3 * nla_total_size(0) /* CTA_TUPLE_PROTO */
> > + 3 * nla_total_size(sizeof(u_int8_t)) /* CTA_PROTO_NUM */
> > @@ -628,6 +626,12 @@ ctnetlink_nlmsg_size(const struct nf_conn *ct)
> > ;
> > }
> >
> > +static size_t ctnetlink_nlmsg_size(const struct nf_conn *ct)
> > +{
> > + return NLMSG_ALIGN(sizeof(struct nfgenmsg)) +
> > + ctnetlink_nlmsg_payload_size(ct);
> > +}
> > +
> > #ifdef CONFIG_NF_CONNTRACK_EVENTS
> > static int
> > ctnetlink_conntrack_event(unsigned int events, struct nf_ct_event *item)
> > @@ -2134,34 +2138,6 @@ ctnetlink_alloc_expect(const struct nlattr *const cda[], struct nf_conn *ct,
> > struct nf_conntrack_tuple *mask);
> >
> > #ifdef CONFIG_NETFILTER_NETLINK_QUEUE_CT
> > -static size_t
> > -ctnetlink_nfqueue_build_size(const struct nf_conn *ct)
>
> A little apart from this issue, it seems that original
> ctnetlink_nlmsg_size() lacks CTA_USE size.
>
> A conntrack information attached to nfqueue does not have
> CTA_COUNTERS_ and also CTA_USE attrs, but this change allocates
> a space for it. If we reuse ctnetlink_nlmsg_size() to avoid a
> code duplication, I think it would be better to comment it.
You're right, I have to revisit this. Will send a v2 of this patchset.
next prev parent reply other threads:[~2015-09-10 0:05 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-08 16:54 [PATCH RFC 0/3] Rework nfnetlink_queue conntrack support Pablo Neira Ayuso
2015-09-08 16:54 ` [PATCH RFC 1/3] netfilter: ctnetlink: remove ctnetlink_nfqueue_build_size() Pablo Neira Ayuso
2015-09-09 9:53 ` Ken-ichirou MATSUZAWA
2015-09-10 0:12 ` Pablo Neira Ayuso [this message]
2015-09-08 16:54 ` [PATCH RFC 2/3] netfilter: nfnetlink_queue: get rid of nfnetlink_queue_ct.c Pablo Neira Ayuso
2015-09-08 16:54 ` [PATCH RFC 3/3] netfilter: rename nfnetlink_queue_core.c to nfnetlink_queue.c Pablo Neira Ayuso
2015-09-09 9:55 ` Ken-ichirou MATSUZAWA
2015-09-10 0:09 ` Pablo Neira Ayuso
2015-09-10 8:02 ` nfqueue batch verdict with conntrack (was [PATCH RFC 3/3] netfilter: rename nfnetlink_queue_core.c to nfnetlink_queue.c) Ken-ichirou MATSUZAWA
2015-09-10 9:20 ` [PATCH nf-next 0/1] netfilter: nfnetlink_queue: return -EOPNOTSUPP if QUEUE_CT is disabled Ken-ichirou MATSUZAWA
2015-09-10 9:24 ` [PATCH nf-next 1/1] " Ken-ichirou MATSUZAWA
2015-09-09 9:50 ` [PATCH RFC 0/3] Rework nfnetlink_queue conntrack support Ken-ichirou MATSUZAWA
2015-09-09 9:58 ` [PATCH lnf-queue] examples: attaching a conntrack information Ken-ichirou MATSUZAWA
2015-09-09 20:29 ` Florian Westphal
2015-09-09 22:22 ` Ken-ichirou MATSUZAWA
2015-09-09 22:58 ` Florian Westphal
2015-09-10 0:02 ` Pablo Neira Ayuso
2015-09-10 2:26 ` [PATCHv2 " Ken-ichirou MATSUZAWA
2015-09-10 8:58 ` [PATCH " Ken-ichirou MATSUZAWA
2015-09-10 0:06 ` [PATCH RFC 0/3] Rework nfnetlink_queue conntrack support Pablo Neira Ayuso
2015-09-11 3:05 ` Ken-ichirou MATSUZAWA
2015-09-11 3:07 ` [PATCH nf-next 1/3] netfilter: nfnetlink_queue: rename related to nfqueue attaching conntrack info Ken-ichirou MATSUZAWA
2015-09-30 22:03 ` Pablo Neira Ayuso
2015-09-11 3:09 ` [PATCH nf-next 2/3] netfilter: nf_conntrack_netlink: add const qualifier to nfnl_hook Ken-ichirou MATSUZAWA
2015-09-11 3:10 ` [PATCH nf-next 3/3] netfilter: nfnetlink_log: allow to attach conntrack Ken-ichirou MATSUZAWA
2015-09-30 22:10 ` Pablo Neira Ayuso
2015-09-11 3:12 ` [PATCH lnf-log 1/3] include: Sync with kernel headers Ken-ichirou MATSUZAWA
2015-10-12 15:21 ` Pablo Neira Ayuso
2015-09-11 3:14 ` [PATCH lnf-log 2/3] nlmsg: Add NFULA_CT and NFULA_CT_INFO attributes support Ken-ichirou MATSUZAWA
2015-10-12 15:21 ` Pablo Neira Ayuso
2015-09-11 3:15 ` [PATCH lnf-log 3/3] utils: nf-log: attaching a conntrack information Ken-ichirou MATSUZAWA
2015-10-12 15:26 ` Pablo Neira Ayuso
2015-10-15 4:35 ` Ken-ichirou MATSUZAWA
2015-10-15 4:39 ` [PATCHv2 lnf-log] " Ken-ichirou MATSUZAWA
2015-10-16 16:59 ` Pablo Neira Ayuso
2016-11-15 7:36 ` Ken-ichirou MATSUZAWA
2016-11-15 7:38 ` Ken-ichirou MATSUZAWA
2016-11-24 11:54 ` Pablo Neira Ayuso
2016-11-24 13:15 ` 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=20150910001217.GD5734@salvia \
--to=pablo@netfilter.org \
--cc=chamaken@gmail.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).