From: Michal Kubecek <mkubecek@suse.cz>
To: netdev@vger.kernel.org
Cc: Johannes Berg <johannes@sipsolutions.net>,
"David S. Miller" <davem@davemloft.net>,
David Ahern <dsahern@gmail.com>, Jiri Pirko <jiri@mellanox.com>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
Florian Westphal <fw@strlen.de>,
"netfilter-devel@vger.kernel.org"
<netfilter-devel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 0/3] make nla_nest_start() add NLA_F_NESTED flag
Date: Fri, 26 Apr 2019 13:56:29 +0200 [thread overview]
Message-ID: <20190426115629.GH26549@unicorn.suse.cz> (raw)
In-Reply-To: <a3626aeca20280e8253b575fe72309b2009474a8.camel@sipsolutions.net>
On Fri, Apr 26, 2019 at 01:23:46PM +0200, Johannes Berg wrote:
> On Fri, 2019-04-26 at 13:19 +0200, Michal Kubecek wrote:
> > On Fri, Apr 26, 2019 at 11:24:15AM +0200, Johannes Berg wrote:
> > > On Fri, 2019-04-26 at 09:13 +0000, Michal Kubecek wrote:
> > >
> > > > Another observation was that even if NLA_F_NESTED flag was introduced in
> > > > 2007, only few netlink based interfaces set it in kernel generated messages
> > > > and even many recently added APIs omit it. That is unfortunate as without
> > > > the flag, message parsers not familiar with attribute semantics cannot
> > > > recognize nested attributes and do not see message structure; this affects
> > > > e.g. wireshark dissector or mnl_nlmsg_fprintf() from libmnl.
> > >
> > > Indeed.
> > >
> > > I wonder if we should also (start) enforcing that the userspace sender
> > > side sets this, if the policy is strict?
> >
> > I suppose we should, at least the part that attribute with NLA_NESTED
> > policy has NLA_F_NESTED flag. I'm not so sure about the opposite (i.e.
> > that attributes with other policies do not have the flag) as when I was
> > checking where kernel accesses nlattr::nla_type directly rather than
> > with nla_type(), I stumbled upon an attribute NL80211_ATTR_VENDOR_DATA
> > which has policy NLA_BINARY but is sometimes a nest, AFAICS.
>
> I guess anyway we can only do it for *new* things, not really for all
> existing attributes.
Right... but what I wanted to say is that if there is already (at least)
one attribute which may or may not be a nest, depending on a context, we
should expect there may be also new attributes like that in the future.
Michal
next prev parent reply other threads:[~2019-04-26 11:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-26 9:13 [PATCH net-next 0/3] make nla_nest_start() add NLA_F_NESTED flag Michal Kubecek
2019-04-26 9:13 ` [PATCH net-next 1/3] netlink: " Michal Kubecek
2019-04-26 10:51 ` Jiri Pirko
2019-04-26 15:03 ` David Ahern
2019-04-26 9:13 ` [PATCH net-next 2/3] ipset: drop ipset_nest_start() and ipset_nest_end() Michal Kubecek
2019-04-26 16:59 ` Jozsef Kadlecsik
2019-04-26 9:13 ` [PATCH net-next 3/3] net: fix two coding style issues Michal Kubecek
2019-04-26 9:24 ` [PATCH net-next 0/3] make nla_nest_start() add NLA_F_NESTED flag Johannes Berg
2019-04-26 11:19 ` Michal Kubecek
2019-04-26 11:23 ` Johannes Berg
2019-04-26 11:56 ` Michal Kubecek [this message]
2019-04-26 12:17 ` Johannes Berg
2019-04-26 15:00 ` David Ahern
2019-04-26 16:02 ` Johannes Berg
2019-04-26 16:45 ` Michal Kubecek
2019-04-27 21:04 ` David Miller
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=20190426115629.GH26549@unicorn.suse.cz \
--to=mkubecek@suse.cz \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=fw@strlen.de \
--cc=jiri@mellanox.com \
--cc=johannes@sipsolutions.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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).