From: Florent Fourcot Date: Tue, 19 Apr 2022 12:51:51 +0000 (+0200) Subject: Revert "rtnetlink: return EINVAL when request cannot succeed" X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6f37c9f9dfbf9a9645ec5ea2d9370b0fd3e9081e;p=linux.git Revert "rtnetlink: return EINVAL when request cannot succeed" This reverts commit b6177d3240a4 ip-link command is testing kernel capability by sending a RTM_NEWLINK request, without any argument. It accepts everything in reply, except EOPNOTSUPP and EINVAL (functions iplink_have_newlink / accept_msg) So we must keep compatiblity here, invalid empty message should not return EINVAL Signed-off-by: Florent Fourcot Tested-by: Guillaume Nault Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index b943336908a7d..73f2cbc440c9b 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -3457,7 +3457,7 @@ replay: return rtnl_group_changelink(skb, net, nla_get_u32(tb[IFLA_GROUP]), ifm, extack, tb); - return -EINVAL; + return -ENODEV; } if (tb[IFLA_MAP] || tb[IFLA_PROTINFO])