netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@redhat.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Jesper Dangaard Brouer <hawk@diku.dk>,
	Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
	Netfilter Developer Mailing List
	<netfilter-devel@vger.kernel.org>,
	netfilter@vger.kernel.org,
	Pablo Neira Ayuso <pablo@netfilter.org>
Subject: Re: Error reporting in Netlink (Re: Xtables2 Netlink spec)
Date: Thu, 16 Dec 2010 14:43:33 +0100	[thread overview]
Message-ID: <1292507013.3395.19.camel@lsx> (raw)
In-Reply-To: <alpine.LNX.2.01.1012161322450.6728@obet.zrqbmnf.qr>

On Thu, 2010-12-16 at 13:51 +0100, Jan Engelhardt wrote: 
> On Thursday 2010-12-16 10:57, Jesper Dangaard Brouer wrote:
> 
> >Cc.ed Thomas Graf (tgraf@redhat.com), Thomas presented some interesting 
> >ideas on netlink error-codes and strings during NetConf 2010, see:
> >
> >http://vger.kernel.org/netconf2010.html 
> >http://vger.kernel.org/netconf2010_slides/tgraf_netconf10.odp
> 
> The idea is appending an error string is ok for Netlink as a protocol
> (specification-wise), but the size constraints of the skbuffs in the
> Linux may make its practical implementation a little harder. "Half of
> the packet" is already used for the original request message, and
> cramming an extra error string may bust the space.
> It also does not look very netlinky to not use nlattrs ;-)

Why not use nlattr to encode the error string? It would make error
messages easier to extend in the future. At some point we might want
to add an offset field which points into the original netlink message
describing the attribute which caused the failure.

> On Wed, 15 Dec 2010, Jozsef Kadlecsik came about with:
> >
> >>I have got a three-level error coding in my mind: general, standard 
> >>error codes (ENOMEM, EPERM, etc.), general netfilter specific ones 
> >>(like NFXTE_HOOKMASK_NOT_ADHERED) and table/match/target specific 
> >>ones.
> >>
> >>But I do realize that it's much easier (and therefore quite tempting) 
> >>to construct the full error message in kernel space and just send it 
> >>back. However, that'd make quite hard to support internationalization.

Thinking of netlink protocols in general and netfilter in specific,
maintaining a list of reserved error codes for each subsystem/target/
module will result in an unbearable pain if the error codes are not
separated into individual namespaces for each module.

That would in turn require each module to define a unique number or
some form of namespace resolution mechanism which does not help to keep
things simple.

This is the main reason why I advocate the use of error strings.

> It's not like those strings change all that much.
> 
> 
> >To support internationalization, we could just add an error-number-code 
> >in front of the constructed error message?
> 
> Buying us what? If you change the string, but the gettext lookup is 
> based upon a number, you will get an outdated translation, which is not 
> nice either. IMHO: Better an English message than an inaccurate message.

Do we *really* need internationalization for error messages on this
level? Primarily userspace should be in charge of checking for all kinds
of erroneous user input and produce meaningful context based,
translatable error messages. Error messages produced by the kernel
should be the exception and not a substitute for proper userspace error
handling.


  reply	other threads:[~2010-12-16 13:43 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-24 22:29 Xtables2 Netlink spec Jan Engelhardt
2010-11-25 11:42 ` Pablo Neira Ayuso
2010-11-25 13:35   ` Jan Engelhardt
2010-11-25 14:21     ` Pablo Neira Ayuso
2010-11-25 21:46       ` Jan Engelhardt
2010-11-26  8:25         ` Pablo Neira Ayuso
2010-11-26 13:59           ` Jan Engelhardt
2010-11-26 19:48             ` Jozsef Kadlecsik
2010-11-26 19:55               ` Jan Engelhardt
2010-11-26 20:05                 ` Jozsef Kadlecsik
2010-11-26 21:33                   ` Jan Engelhardt
     [not found]                     ` <alpine.DEB.2.00.1011270951330.20431@blackhole.kfki.hu>
2010-11-27 13:39                       ` Jan Engelhardt
2010-11-27 17:04                         ` Jozsef Kadlecsik
2010-11-27 17:35                           ` Jan Engelhardt
2010-11-27 20:42                             ` Jozsef Kadlecsik
2010-11-29 12:30                               ` Pablo Neira Ayuso
2010-11-29 12:39                                 ` Jozsef Kadlecsik
2010-11-29 12:55                                   ` Pablo Neira Ayuso
2010-11-29 13:26                                     ` Jan Engelhardt
2010-11-29 13:49                                   ` Pablo Neira Ayuso
2010-11-29 12:23                 ` Pablo Neira Ayuso
2010-11-27 11:10             ` Pablo Neira Ayuso
2010-11-26 15:27           ` Jan Engelhardt
2010-11-27 12:25             ` Pablo Neira Ayuso
2010-12-03 21:03           ` Jan Engelhardt
2010-12-07  7:49             ` Pablo Neira Ayuso
2010-12-07 13:30               ` Jan Engelhardt
2010-12-08 11:36                 ` Pablo Neira Ayuso
2010-11-26 19:01 ` Jozsef Kadlecsik
2010-12-09 12:08   ` Pablo Neira Ayuso
2010-12-14  2:01     ` Jan Engelhardt
2010-12-14  2:16       ` James Nurmi
2010-12-14  3:46         ` Jan Engelhardt
2010-12-15 13:54       ` Pablo Neira Ayuso
2010-12-16 14:05         ` Thomas Graf
2010-12-16 14:22           ` Jan Engelhardt
2010-12-17  7:25             ` Thomas Graf
2010-12-17  9:35               ` Jan Engelhardt
2010-12-17  9:50                 ` Pablo Neira Ayuso
2010-12-17  9:55           ` Pablo Neira Ayuso
2010-12-17 14:56             ` Jan Engelhardt
2010-12-15  4:55   ` Jan Engelhardt
2010-12-15  8:51     ` Jozsef Kadlecsik
2010-12-16  9:57       ` Jesper Dangaard Brouer
2010-12-16 12:51         ` Error reporting in Netlink (Re: Xtables2 Netlink spec) Jan Engelhardt
2010-12-16 13:43           ` Thomas Graf [this message]
2010-12-16 13:51             ` Jan Engelhardt
2010-12-16 14:19               ` Thomas Graf
2010-12-17 10:00                 ` Pablo Neira Ayuso
2010-12-16 14:47             ` Jozsef Kadlecsik
2010-12-16 15:09               ` Jan Engelhardt
2010-12-16 23:31             ` Patrick McHardy
2010-12-17  6:58               ` Thomas Graf
2010-12-16 23:23           ` Patrick McHardy
2010-12-17 10:02             ` 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=1292507013.3395.19.camel@lsx \
    --to=tgraf@redhat.com \
    --cc=hawk@diku.dk \
    --cc=jengelh@medozas.de \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@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).