rtnl: RTM_GETNETCONF: fix wrong return value
[ Upstream commit a97eb33ff225f34a8124774b3373fd244f0e83ce ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9b87f63bf8
commit
b7c2e2acc6
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user