netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug#489340: iproute2: no error message when link up command fails.
@ 2008-07-16 22:00 Andreas Henriksson
  2008-07-16 22:03 ` Stephen Hemminger
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Henriksson @ 2008-07-16 22:00 UTC (permalink / raw)
  To: stephen.hemminger; +Cc: Johannes Berg, 489340, netdev

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-07-17 10:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).