summaryrefslogtreecommitdiffstats
path: root/net/core/rtnetlink.c
diff options
context:
space:
mode:
authorThomas Graf2007-04-05 23:35:52 +0200
committerDavid S. Miller2007-04-26 07:28:34 +0200
commit038890fed8d1fa95bbbdeb517f5710eb75fa9e2e (patch)
tree3dc8cc28ada84f609fe415ff7b03f5b97e6b3f98 /net/core/rtnetlink.c
parent[NET]: Move generic skbuff stuff from XFRM code to generic code (diff)
downloadkernel-qcow2-linux-038890fed8d1fa95bbbdeb517f5710eb75fa9e2e.tar.gz
kernel-qcow2-linux-038890fed8d1fa95bbbdeb517f5710eb75fa9e2e.tar.xz
kernel-qcow2-linux-038890fed8d1fa95bbbdeb517f5710eb75fa9e2e.zip
[RTNL]: Improve error codes for unsupported operations
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r--net/core/rtnetlink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index fa5f938b37ee..5266df337051 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -862,7 +862,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
type = nlh->nlmsg_type;
if (type > RTM_MAX)
- return -EINVAL;
+ return -EOPNOTSUPP;
type -= RTM_BASE;
@@ -885,7 +885,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
dumpit = rtnl_get_dumpit(family, type);
if (dumpit == NULL)
- return -EINVAL;
+ return -EOPNOTSUPP;
return netlink_dump_start(rtnl, skb, nlh, dumpit, NULL);
}
@@ -913,7 +913,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
doit = rtnl_get_doit(family, type);
if (doit == NULL)
- return -EINVAL;
+ return -EOPNOTSUPP;
return doit(skb, nlh, (void *)&rta_buf[0]);
}