From: Johannes Berg <johannes@sipsolutions.net>
To: Thomas Graf <tgraf@suug.ch>
Cc: davem <davem@davemloft.net>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] genetlink custom attribute type
Date: Wed, 27 Sep 2006 14:18:42 +0200 [thread overview]
Message-ID: <1159359523.2698.27.camel@ux156> (raw)
In-Reply-To: <20060926094408.GT18349@postel.suug.ch>
On Tue, 2006-09-26 at 11:44 +0200, Thomas Graf wrote:
> Thinking it over I'm still not completely happy with this. A
> small subset of all the validation tasks is simply too complex
> to be put into the policy. The validation of your type value
> array is such a case, address fields with variable length based
> on their family is another. I think it's just not worth to
> blow up struct nla_policy by 12 bytes per entry just to save
> some code.
Oh, I just had another idea... Feel free to ignore me if you think that
having this done in some generic way isn't worth it though. As I said,
it doesn't really make a difference to me in the end :)
Currently, we always pass a "struct nla_policy *policy" into things,
which really is an array. We could instead pass in a new
struct nla_validation {
int (*custom_validate)(struct nlattr *nla);
struct nla_policy *policy;
};
and call custom_validate() whenever we encounter something in the policy
that has type NLA_CUSTOM_VALIDATE. Downsides of this approach are that
it requires changing all current users, and introduces 16 bytes constant
overhead on 64-bit platforms, the size of nla_validation.
johannes
next prev parent reply other threads:[~2006-09-27 12:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-26 7:25 [PATCH] genetlink custom attribute type Johannes Berg
2006-09-26 9:44 ` Thomas Graf
2006-09-26 10:04 ` Johannes Berg
2006-09-26 20:09 ` David Miller
2006-09-27 12:18 ` Johannes Berg [this message]
2006-10-02 13:49 ` Thomas Graf
2006-10-02 13:56 ` 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=1159359523.2698.27.camel@ux156 \
--to=johannes@sipsolutions.net \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=tgraf@suug.ch \
/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).