All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] genetlink per-op policy export
@ 2020-10-03  8:44 Johannes Berg
  2020-10-03  8:44 ` [PATCH v3 1/5] netlink: compare policy more accurately Johannes Berg
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Johannes Berg @ 2020-10-03  8:44 UTC (permalink / raw)
  To: netdev; +Cc: Jakub Kicinski, David Ahern

Hi,

Here's a respin, now including Jakub's patch last so that it will
do the right thing from the start.

The first patch remains the same, of course; the others have mostly
some rebasing going on, except for the actual export patch (patch 4)
which is adjusted per Jakub's review comments about exporting the
policy only if it's actually used for do/dump.

To see that, the dump for "nlctrl" (i.e. the generic netlink control)
is instructive, because the ops are this:

        {
                .cmd            = CTRL_CMD_GETFAMILY,
                .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
                .policy         = ctrl_policy_family,
                .maxattr        = ARRAY_SIZE(ctrl_policy_family) - 1,
                .doit           = ctrl_getfamily,
                .dumpit         = ctrl_dumpfamily,
        },
        {
                .cmd            = CTRL_CMD_GETPOLICY,
                .policy         = ctrl_policy_policy,
                .maxattr        = ARRAY_SIZE(ctrl_policy_policy) - 1,
                .start          = ctrl_dumppolicy_start,
                .dumpit         = ctrl_dumppolicy,
                .done           = ctrl_dumppolicy_done,
        },

So we exercise both "don't have doit" and "GENL_DONT_VALIDATE_DUMP"
parts, and get (with the current genl patch):

$ genl ctrl policy name nlctrl
	ID: 0x10  op 3 policies: do=0
	ID: 0x10  op 10 policies: dump=1
	ID: 0x10  policy[0]:attr[1]: type=U16 range:[0,65535]
	ID: 0x10  policy[0]:attr[2]: type=NUL_STRING max len:15
	ID: 0x10  policy[1]:attr[1]: type=U16 range:[0,65535]
	ID: 0x10  policy[1]:attr[2]: type=NUL_STRING max len:15
	ID: 0x10  policy[1]:attr[10]: type=U32 range:[0,4294967295]

johannes



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-10-03 21:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-03  8:44 [PATCH v3 0/5] genetlink per-op policy export Johannes Berg
2020-10-03  8:44 ` [PATCH v3 1/5] netlink: compare policy more accurately Johannes Berg
2020-10-03  8:44 ` [PATCH v3 2/5] netlink: rework policy dump to support multiple policies Johannes Berg
2020-10-03  8:44 ` [PATCH v3 3/5] genetlink: factor skb preparation out of ctrl_dumppolicy() Johannes Berg
2020-10-03  8:44 ` [PATCH v3 4/5] genetlink: properly support per-op policy dumping Johannes Berg
2020-10-03  8:44 ` [PATCH v3 5/5] genetlink: allow dumping command-specific policy Johannes Berg
2020-10-03 15:15 ` [PATCH v3 0/5] genetlink per-op policy export Jakub Kicinski
2020-10-03 21:18   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.