Skip to content

Commit

Permalink
net: if: Init must be called before setting the name
Browse files Browse the repository at this point in the history
As the interface init function might configure the system
such a way that would affect the naming of the network
interface, we need to call the init before setting the name.
This is mostly needed by Wifi where the Wifi driver needs
to mark its network interface as Wifi interface as by default
the Wifi interface will look like Ethernet one.

(cherry picked from commit dceff4a)

Original-Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
GitOrigin-RevId: dceff4a
Change-Id: I9543a02766edf3c1b8d5dda68e26bd7f4200c9e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5324197
Commit-Queue: Keith Short <keithshort@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Tested-by: Keith Short <keithshort@chromium.org>
  • Loading branch information
jukkar authored and Chromeos LUCI committed Feb 26, 2024
1 parent d789635 commit 30c6619
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion subsys/net/ip/net_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -4998,14 +4998,15 @@ void net_if_init(void)

STRUCT_SECTION_FOREACH(net_if, iface) {

init_iface(iface);

#if defined(CONFIG_NET_INTERFACE_NAME)
memset(net_if_get_config(iface)->name, 0,
sizeof(iface->config.name));

set_default_name(iface);
#endif

init_iface(iface);
if_count++;
}

Expand Down

0 comments on commit 30c6619

Please sign in to comment.