Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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>

authored by

Florent Fourcot and committed by
David S. Miller
6f37c9f9 59359597

+1 -1
+1 -1
net/core/rtnetlink.c
··· 3457 3457 return rtnl_group_changelink(skb, net, 3458 3458 nla_get_u32(tb[IFLA_GROUP]), 3459 3459 ifm, extack, tb); 3460 - return -EINVAL; 3460 + return -ENODEV; 3461 3461 } 3462 3462 3463 3463 if (tb[IFLA_MAP] || tb[IFLA_PROTINFO])