Skip to content

Commit 23b85c3

Browse files
SeppoTakalojfischer-no
authored andcommitted
[nrf fromtree] drivers: eth: native_tap: Init MAC properly
Set static or random MAC before calling net_linkaddr_set(). Signed-off-by: Seppo Takalo <[email protected]> (cherry picked from commit 673853ae5a9b38c8d9f204ad1998b97a305020d8)
1 parent a30bacc commit 23b85c3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/ethernet/eth_native_tap.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static void create_rx_handler(struct eth_context *ctx)
307307
static void eth_iface_init(struct net_if *iface)
308308
{
309309
struct eth_context *ctx = net_if_get_device(iface)->data;
310-
struct net_linkaddr *ll_addr = eth_get_mac(ctx);
310+
struct net_linkaddr *ll_addr;
311311
#if !defined(CONFIG_ETH_NATIVE_TAP_RANDOM_MAC)
312312
const char *mac_addr =
313313
mac_addr_cmd_opt ? mac_addr_cmd_opt : CONFIG_ETH_NATIVE_TAP_MAC_ADDR;
@@ -355,6 +355,8 @@ static void eth_iface_init(struct net_if *iface)
355355
}
356356
#endif
357357

358+
ll_addr = eth_get_mac(ctx);
359+
358360
/* If we have only one network interface, then use the name
359361
* defined in the Kconfig directly. This way there is no need to
360362
* change the documentation etc. and break things.

0 commit comments

Comments
 (0)