netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RTNL]: Improve error codes for unsupported operations
@ 2007-04-05 14:34 Thomas Graf
  2007-04-05 21:34 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Graf @ 2007-04-05 14:34 UTC (permalink / raw)
  To: davem; +Cc: netdev

The most common trigger of these errors is that the
config option hasn't been enable wich would make the
functionality available. Therefore returning EOPNOTSUPP
gives a better idea on what is going wrong.

Signed-off-by: Thomas Graf <tgraf@suug.ch>

Index: net-2.6.22/net/core/rtnetlink.c
===================================================================
--- net-2.6.22.orig/net/core/rtnetlink.c	2007-04-05 13:22:14.000000000 +0200
+++ net-2.6.22/net/core/rtnetlink.c	2007-04-05 13:22:51.000000000 +0200
@@ -861,7 +861,7 @@ static int rtnetlink_rcv_msg(struct sk_b
 
 	type = nlh->nlmsg_type;
 	if (type > RTM_MAX)
-		return -EINVAL;
+		return -EOPNOTSUPP;
 
 	type -= RTM_BASE;
 
@@ -884,7 +884,7 @@ static int rtnetlink_rcv_msg(struct sk_b
 
 		dumpit = rtnl_get_dumpit(family, type);
 		if (dumpit == NULL)
-			return -EINVAL;
+			return -EOPNOTSUPP;
 
 		return netlink_dump_start(rtnl, skb, nlh, dumpit, NULL);
 	}
@@ -912,7 +912,7 @@ static int rtnetlink_rcv_msg(struct sk_b
 
 	doit = rtnl_get_doit(family, type);
 	if (doit == NULL)
-		return -EINVAL;
+		return -EOPNOTSUPP;
 
 	return doit(skb, nlh, (void *)&rta_buf[0]);
 }

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

* Re: [RTNL]: Improve error codes for unsupported operations
  2007-04-05 14:34 [RTNL]: Improve error codes for unsupported operations Thomas Graf
@ 2007-04-05 21:34 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-04-05 21:34 UTC (permalink / raw)
  To: tgraf; +Cc: netdev

From: Thomas Graf <tgraf@suug.ch>
Date: Thu, 5 Apr 2007 16:34:02 +0200

> The most common trigger of these errors is that the
> config option hasn't been enable wich would make the
> functionality available. Therefore returning EOPNOTSUPP
> gives a better idea on what is going wrong.
> 
> Signed-off-by: Thomas Graf <tgraf@suug.ch>

Applied, thanks a lot Thomas.

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

end of thread, other threads:[~2007-04-05 21:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-05 14:34 [RTNL]: Improve error codes for unsupported operations Thomas Graf
2007-04-05 21:34 ` David Miller

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