net: fix net device address assign type
authorPiotr Gardocki <piotrx.gardocki@intel.com>
Wed, 21 Jun 2023 13:21:06 +0000 (15:21 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 23 Jun 2023 02:55:12 +0000 (19:55 -0700)
commit0ec92a8f56ff07237dbe8af7c7a72aba7f957baf
tree4c31017ecedc6608a74a74412047014fb65a0309
parent9a14f2e3dab106df7f27d1730cc540247317d4b9
net: fix net device address assign type

Commit ad72c4a06acc introduced optimization to return from function
quickly if the MAC address is not changing at all. It was reported
that such change causes dev->addr_assign_type to not change
to NET_ADDR_SET from _PERM or _RANDOM.
Restore the old behavior and skip only call to ndo_set_mac_address.

Fixes: ad72c4a06acc ("net: add check for current MAC address in dev_set_mac_address")
Reported-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Piotr Gardocki <piotrx.gardocki@intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20230621132106.991342-1-piotrx.gardocki@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/dev.c