Revert "rtnetlink: return EINVAL when request cannot succeed"
authorFlorent Fourcot <florent.fourcot@wifirst.fr>
Tue, 19 Apr 2022 12:51:51 +0000 (14:51 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Apr 2022 10:02:00 +0000 (11:02 +0100)
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 <florent.fourcot@wifirst.fr>
Tested-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c

index b943336908a7d1a4d60dc45b840a665cab3c1b80..73f2cbc440c9bbf00f725be52448a6bdecd147a5 100644 (file)
@@ -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])