rtnetlink: enable alt_ifname for setlink/newlink
authorFlorent Fourcot <florent.fourcot@wifirst.fr>
Fri, 15 Apr 2022 16:53:28 +0000 (18:53 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 19 Apr 2022 11:38:43 +0000 (13:38 +0200)
commit5ea08b5286f66ee5ac0150668c92d1718e83e1ad
tree74d2e74e0be5db207621e9caec0968c7a7c2696d
parentef2a7c9065cea4e3fbc0390e82d05141abbccd7f
rtnetlink: enable alt_ifname for setlink/newlink

buffer called "ifname" given in function rtnl_dev_get
is always valid when called by setlink/newlink,
but contains only empty string when IFLA_IFNAME is not given. So
IFLA_ALT_IFNAME is always ignored

This patch fixes rtnl_dev_get function with a remove of ifname argument,
and move ifname copy in do_setlink when required.

It extends feature of commit 76c9ac0ee878,
"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>
net/core/rtnetlink.c