diff mbox series

[net-next] Revert "rtnetlink: return EINVAL when request cannot succeed"

Message ID 20220419125151.15589-1-florent.fourcot@wifirst.fr (mailing list archive)
State Accepted
Commit 6f37c9f9dfbf9a9645ec5ea2d9370b0fd3e9081e
Delegated to: Netdev Maintainers
Headers show
Series [net-next] Revert "rtnetlink: return EINVAL when request cannot succeed" | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2 this patch: 2
netdev/cc_maintainers fail 4 maintainers not CCed: davem@davemloft.net kuba@kernel.org petrm@nvidia.com pabeni@redhat.com
netdev/build_clang success Errors and warnings before: 9 this patch: 9
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
netdev/checkpatch warning WARNING: 'compatiblity' may be misspelled - perhaps 'compatibility'?
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Florent Fourcot April 19, 2022, 12:51 p.m. UTC
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>
---
 net/core/rtnetlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guillaume Nault April 20, 2022, 2:48 p.m. UTC | #1
On Tue, Apr 19, 2022 at 02:51:51PM +0200, Florent Fourcot wrote:
> 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

"ip link" is currently unusable on net-next without this patch.
Can we please rush this fix in?

Tested-by: Guillaume Nault <gnault@redhat.com>
Fixes: b6177d3240a4 ("rtnetlink: return EINVAL when request cannot succeed")

> Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr>
> ---
>  net/core/rtnetlink.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index b943336908a7..73f2cbc440c9 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -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 -EINVAL;
> +		return -ENODEV;
>  	}
>  
>  	if (tb[IFLA_MAP] || tb[IFLA_PROTINFO])
> -- 
> 2.30.2
>
Eric Dumazet April 21, 2022, 1:15 a.m. UTC | #2
On 4/19/22 05:51, Florent Fourcot wrote:
> 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>


Reviewed-by: Eric Dumazet <edumazet@google.com>


Thanks for fixing this issue.
patchwork-bot+netdevbpf@kernel.org April 22, 2022, 10:10 a.m. UTC | #3
Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 19 Apr 2022 14:51:51 +0200 you wrote:
> 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
> 
> [...]

Here is the summary with links:
  - [net-next] Revert "rtnetlink: return EINVAL when request cannot succeed"
    https://git.kernel.org/netdev/net-next/c/6f37c9f9dfbf

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index b943336908a7..73f2cbc440c9 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -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 -EINVAL;
+		return -ENODEV;
 	}
 
 	if (tb[IFLA_MAP] || tb[IFLA_PROTINFO])