提交 038890fe 编写于 作者: T Thomas Graf 提交者: David S. Miller

[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: NThomas Graf <tgraf@suug.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 716ea3a7
......@@ -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]);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册