rtnetlink: return EINVAL when request cannot succeed

A request without interface name/interface index/interface group cannot
work. We should return EINVAL

Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr>
Signed-off-by: Brian Baboch <brian.baboch@wifirst.fr>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Florent Fourcot 2022-04-15 18:53:30 +02:00 committed by Paolo Abeni
parent dee04163e9
commit b6177d3240

View file

@ -3457,7 +3457,7 @@ static int __rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
return rtnl_group_changelink(skb, net,
nla_get_u32(tb[IFLA_GROUP]),
ifm, extack, tb);
return -ENODEV;
return -EINVAL;
}
if (tb[IFLA_MAP] || tb[IFLA_PROTINFO])