From: Thomas Graf <tgraf@suug.ch>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [RTNL]: Improve error codes for unsupported operations
Date: Thu, 5 Apr 2007 16:34:02 +0200 [thread overview]
Message-ID: <20070405143402.GY521@postel.suug.ch> (raw)
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]);
}
next reply other threads:[~2007-04-05 14:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-05 14:34 Thomas Graf [this message]
2007-04-05 21:34 ` [RTNL]: Improve error codes for unsupported operations David Miller
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=20070405143402.GY521@postel.suug.ch \
--to=tgraf@suug.ch \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.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).