From: Stephen Hemminger <shemminger@vyatta.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Andreas Henriksson <andreas@fatal.se>,
stephen.hemminger@vyatta.com, 489340@bugs.debian.org,
netdev@vger.kernel.org
Subject: Re: iproute2: no error message when link up command fails.
Date: Wed, 16 Jul 2008 15:53:54 -0700 [thread overview]
Message-ID: <20080716155354.28281053@extreme> (raw)
In-Reply-To: <1216247722.3422.38.camel@johannes.berg>
On Thu, 17 Jul 2008 00:35:22 +0200
Johannes Berg <johannes@sipsolutions.net> wrote:
>
> > > (By the way, most uses of rtnl_* seems to be if (rtnl_* < 0) exit(1); in
> > > iproute2 currently. The error messages are in libnetlink.)
>
> > The problem is the driver is responding with an error packet but the
> > errno is 0. This looks like a kernel bug, not an library bug.
>
> I don't think so, the recvmsg() call worked fine, but the message
> indicates that the netlink consumer had an error. Or am I missing
> something?
>
> johannes
The netlink message in question is marked as type ERROR but the errno
encoded in the message is zero.
if (h->nlmsg_type == NLMSG_ERROR) {
struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
if (l < sizeof(struct nlmsgerr)) {
fprintf(stderr, "ERROR truncated\n");
} else {
errno = -err->error;
if (errno == 0) {
if (answer)
memcpy(answer, h, h->nlmsg_len);
return 0;
}
perror("RTNETLINK answers");
}
So the netlink library just treats as a successful return.
To me it looks like the problem is in the kernel sending back
a NLMSG_ERROR with errno of zero. Some code path isn't setting
it up properly.
next prev parent reply other threads:[~2008-07-16 22:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-16 22:00 Bug#489340: iproute2: no error message when link up command fails Andreas Henriksson
2008-07-16 22:03 ` Stephen Hemminger
2008-07-16 22:27 ` Andreas Henriksson
2008-07-16 22:26 ` Stephen Hemminger
2008-07-16 22:35 ` Johannes Berg
2008-07-16 22:53 ` Stephen Hemminger [this message]
2008-07-17 0:31 ` Andreas Henriksson
2008-07-17 9:26 ` Patrick McHardy
2008-07-17 9:59 ` Jarek Poplawski
2008-07-17 10:31 ` jamal
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=20080716155354.28281053@extreme \
--to=shemminger@vyatta.com \
--cc=489340@bugs.debian.org \
--cc=andreas@fatal.se \
--cc=johannes@sipsolutions.net \
--cc=netdev@vger.kernel.org \
--cc=stephen.hemminger@vyatta.com \
/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).