Skip to content

Commit

Permalink
rtnetlink: return ENODEV when IFLA_ALT_IFNAME is used in dellink
Browse files Browse the repository at this point in the history
If IFLA_ALT_IFNAME is set and given interface is not found,
we should return ENODEV and be consistent with IFLA_IFNAME
behaviour
This commit extends feature of commit 76c9ac0,
"net: rtnetlink: add possibility to use alternative names as message handle"

CC: Jiri Pirko <jiri@mellanox.com>
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>
  • Loading branch information
Florent Fourcot authored and Paolo Abeni committed Apr 19, 2022
1 parent 5ea08b5 commit dee0416
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -3158,7 +3158,7 @@ static int rtnl_dellink(struct sk_buff *skb, struct nlmsghdr *nlh,
goto out;

if (!dev) {
if (tb[IFLA_IFNAME] || ifm->ifi_index > 0)
if (tb[IFLA_IFNAME] || tb[IFLA_ALT_IFNAME] || ifm->ifi_index > 0)
err = -ENODEV;

goto out;
Expand Down

0 comments on commit dee0416

Please sign in to comment.