Skip to content

Commit

Permalink
rtnetlink: return EINVAL when request cannot succeed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Florent Fourcot authored and Paolo Abeni committed Apr 19, 2022
1 parent dee0416 commit b6177d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit b6177d3

Please sign in to comment.