netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@redhat.com>
To: Patrick McHardy <kaber@trash.net>
Cc: Jan Engelhardt <jengelh@medozas.de>,
	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: Fri, 17 Dec 2010 07:58:06 +0100	[thread overview]
Message-ID: <1292569086.3395.59.camel@lsx> (raw)
In-Reply-To: <4D0AA143.3090608@trash.net>

On Fri, 2010-12-17 at 00:31 +0100, Patrick McHardy wrote: 
> I completely disagree. As I said previously, userspace has to have
> knowledge of the kernel interpretation anyways.
> 
> We already have libc calls which define complex errors like:
> 
> stdtod(): if val == HUGE_VAL && errno == ERANGE: positive overflow
> 
> I see no reason why we can't define combination of attributes
> and errno values for netlink messages.
> 
> Something like:
> 
> [IFLA_VLAN_ID] == NULL && errno == EINVAL: missing attribute
> [IFLA_VLAN_LINK] && errno == ENODEV: lower link does not exist
> 
> and so on.

Using strings would still involve including an errno as we currently
do and as I pointed out in my other mail I am also very positive
about including an offset pointer or a attribute type to specify the
attribute that caused the failure.

Maybe I am thinking too much about other netlink protocols where
errors often occur due to complicated combinations of missing attributes
and specific attribute values having special meanings. Those cases
would benefit a lot from error strings.

I really don't want to see:

return nl_errstring(ENOMEM, "Out of memory");

I am aiming at a verbose error or status string which acts as an
additional helping point in case of complicated errors. I really
don't want to replace the method of using errno to report errors
in general.

I thought about using attrs to specify the error and the reason I
did choose strings was that when we introduce new errors in the
kernel we have to update all applications. Which is no problem if
everyone uses libraries, so it is probably trivial for netfilter but
will be less trivial for netlink users as a group.

That said, I completely understand your point of view a well.


  reply	other threads:[~2010-12-17  7:16 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
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 [this message]
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=1292569086.3395.59.camel@lsx \
    --to=tgraf@redhat.com \
    --cc=hawk@diku.dk \
    --cc=jengelh@medozas.de \
    --cc=kaber@trash.net \
    --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).