net/net_if: Do not start TX thread if there is no network interface
And print a warning if that happens. This will also avoid to raise an ASSERT on net_if_tx_thread()'s k_poll as this one will be called with no events to work with. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
f6f8fb0f47
commit
e0a643591d
1 changed files with 5 additions and 0 deletions
|
@ -1673,6 +1673,11 @@ void net_if_init(struct k_sem *startup_sync)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (iface == __net_if_start) {
|
||||||
|
NET_WARN("There is no network interface to work with!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
k_thread_spawn(tx_stack, sizeof(tx_stack),
|
k_thread_spawn(tx_stack, sizeof(tx_stack),
|
||||||
(k_thread_entry_t)net_if_tx_thread,
|
(k_thread_entry_t)net_if_tx_thread,
|
||||||
startup_sync, NULL, NULL, K_PRIO_COOP(7),
|
startup_sync, NULL, NULL, K_PRIO_COOP(7),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue