netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH RFC 4/4] netfilter: nf_tables: add netlink description
Date: Fri, 26 Apr 2019 21:46:33 +0200	[thread overview]
Message-ID: <79a6e186763b199b3fd28ef0dc0e67b3698fea89.camel@sipsolutions.net> (raw)
In-Reply-To: <a2e483388c096b6b4fb76db70b2068cae6279a40.camel@sipsolutions.net>

On Fri, 2019-04-26 at 21:37 +0200, Johannes Berg wrote:

> You're now thinking of the "policy ID" I assigned for the wire format as
> the object ID, but really that's not what it is. The object ID that
> you're looking for is the attribute type of the nested attribute.
> 
> So if you have
> 
> struct nla_policy nested_policy[...] = { ... };
> 
> struct nla_policy policy[...] = {
>     [MY_ATTR] = NLA_POLICY_NESTED(nested_policy),
> };
> 
So if we extend this, say like this:

struct nla_policy policy[...] = {
    [MY_ATTR] = NLA_POLICY_NESTED(nested_policy),
    [MY_OTHER_ATTR] = NLA_POLICY_NESTED(nested_policy),
};

then you could perhaps argue that having an object ID makes sense, and
assigning the same object ID to MY_ATTR and MY_OTHER_ATTR would make
sense?

Of course, my could would assign this the same (temporary) policy ID,
but there can be no reliance on the policy ID beyond what's needed at
runtime to map the attribute to the nested policy.

You still see at runtime that these have the same policy (since they
have the same policy ID), but at the same time presumably there was a
reason to have MY_ATTR and MY_OTHER_ATTR, so perhaps the semantics are
different even if the attributes are the same, as could perhaps be
expected if you have a SET and a CLEAR attribute (MY_ATTR and
MY_OTHER_ATTR respectively) and the contents you give has the same
policy, but different logic?

Basically, I just didn't consider this case to be significant enough to
manually and assign stable IDs of some sort, when we already have them
in the form of the attribute type.

johannes


  reply	other threads:[~2019-04-26 19:46 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07  1:37 [PATCH RFC 0/4] Netlink bus descriptions Pablo Neira Ayuso
2018-02-07  1:37 ` [PATCH RFC 1/4] netlink: add NLA_PAD definition Pablo Neira Ayuso
2019-03-29 10:44   ` Johannes Berg
2018-02-07  1:37 ` [PATCH RFC 2/4] netlink: add generic object description infrastructure Pablo Neira Ayuso
2018-02-08  1:28   ` Randy Dunlap
2018-02-08 16:21     ` Pablo Neira Ayuso
2019-03-29 10:48   ` Johannes Berg
2018-02-07  1:37 ` [PATCH RFC 3/4] netfilter: nfnetlink: add support for netlink descriptions Pablo Neira Ayuso
2018-02-07  1:37 ` [PATCH RFC 4/4] netfilter: nf_tables: add netlink description Pablo Neira Ayuso
2019-03-29 10:59   ` Johannes Berg
2019-04-11 19:26     ` Pablo Neira Ayuso
2019-04-12 11:56       ` Johannes Berg
2019-04-26 16:42         ` Pablo Neira Ayuso
2019-04-26 17:17           ` Johannes Berg
2019-04-26 17:28             ` Johannes Berg
2019-04-26 18:04               ` Pablo Neira Ayuso
2019-04-26 19:14                 ` Johannes Berg
2019-04-26 19:20                   ` Pablo Neira Ayuso
2019-04-26 19:37                     ` Johannes Berg
2019-04-26 19:46                       ` Johannes Berg [this message]
2019-04-27 10:57                         ` Pablo Neira Ayuso
2019-04-28 19:53                           ` Johannes Berg
2019-04-27 10:52                       ` Pablo Neira Ayuso
2019-04-28 19:51                         ` Johannes Berg
2019-04-26 20:47                   ` Michal Kubecek
2019-04-26 20:51                     ` Johannes Berg

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=79a6e186763b199b3fd28ef0dc0e67b3698fea89.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --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).