浏览代码

rtnl: RTM_GETNETCONF: fix wrong return value

An error response from a RTM_GETNETCONF request can return the positive
error value EINVAL in the struct nlmsgerr that can mislead userspace.

Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Anton Protopopov 9 年之前
父节点
当前提交
a97eb33ff2
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      net/ipv4/devinet.c
  2. 1 1
      net/ipv6/addrconf.c

+ 1 - 1
net/ipv4/devinet.c

@@ -1847,7 +1847,7 @@ static int inet_netconf_get_devconf(struct sk_buff *in_skb,
 	if (err < 0)
 		goto errout;
 
-	err = EINVAL;
+	err = -EINVAL;
 	if (!tb[NETCONFA_IFINDEX])
 		goto errout;
 

+ 1 - 1
net/ipv6/addrconf.c

@@ -583,7 +583,7 @@ static int inet6_netconf_get_devconf(struct sk_buff *in_skb,
 	if (err < 0)
 		goto errout;
 
-	err = EINVAL;
+	err = -EINVAL;
 	if (!tb[NETCONFA_IFINDEX])
 		goto errout;