From: Florent Fourcot Date: Fri, 15 Apr 2022 16:53:29 +0000 (+0200) Subject: rtnetlink: return ENODEV when IFLA_ALT_IFNAME is used in dellink X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=dee04163e9f2feabb77615c630a1e31a91cc4449;p=linux.git rtnetlink: return ENODEV when IFLA_ALT_IFNAME is used in dellink 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 76c9ac0ee878, "net: rtnetlink: add possibility to use alternative names as message handle" CC: Jiri Pirko Signed-off-by: Florent Fourcot Signed-off-by: Brian Baboch Reviewed-by: Jakub Kicinski Signed-off-by: Paolo Abeni --- diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 5899b1d2de144..73f2cbc440c9b 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -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;