From: Andreas Henriksson <andreas@fatal.se>
To: stephen.hemminger@vyatta.com
Cc: Johannes Berg <johannes@sipsolutions.net>,
489340@bugs.debian.org, netdev@vger.kernel.org
Subject: Bug#489340: iproute2: no error message when link up command fails.
Date: Thu, 17 Jul 2008 00:00:58 +0200 [thread overview]
Message-ID: <20080716220058.GA31425@amd64.fatal.se> (raw)
Hi Stephen and co.!
Johannes Berg reported that iproute2 doesn't give any error message when
"ip link set ... up" failed for him (as opposed to ifconfig):
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=489340
The ways he suggested didn't work for me to reproduce, but I found out
simply using the wmaster0 device works as a testcase.
(You'll need a wireless device, probably with a driver based on the new
mac80211 stack).
I've debugged this into a place in the bundled rtnetlink library where
if there's a netlink error - it is ignored if there's no errno, which
seems weird. I don't really understand the code, but this "proof of
concept" patch makes "ip link set dev wmaster0 up" spit out an error
message atleast. Could you please have a look at what's going on here?
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index 5ae64f7..afa58fb 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -351,6 +351,7 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
if (errno == 0) {
if (answer)
memcpy(answer, h, h->nlmsg_len);
+ fprintf(stderr, "Unknown netlink error.\n");
return 0;
}
perror("RTNETLINK answers");
For the record, here's what ifconfig says:
$ sudo ifconfig wmaster0 up
SIOCSIFFLAGS: Operation not supported
--
Regards,
Andreas Henriksson
next reply other threads:[~2008-07-16 22:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-16 22:00 Andreas Henriksson [this message]
2008-07-16 22:03 ` iproute2: no error message when link up command fails 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
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=20080716220058.GA31425@amd64.fatal.se \
--to=andreas@fatal.se \
--cc=489340@bugs.debian.org \
--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).