rtnetlink: return EINVAL when request cannot succeed
authorFlorent Fourcot <florent.fourcot@wifirst.fr>
Fri, 15 Apr 2022 16:53:30 +0000 (18:53 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 19 Apr 2022 11:38:55 +0000 (13:38 +0200)
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>
net/core/rtnetlink.c

index 73f2cbc..b943336 100644 (file)
@@ -3457,7 +3457,7 @@ replay:
                        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])