net: support configuring offloaded network device as default interface

Adds Kconfig option for making an offloaded network device the default
interface.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
This commit is contained in:
Daniel Mangum 2025-01-06 12:23:53 -05:00 committed by Benjamin Cabé
parent 6ab5c00336
commit 2522bb0f1b
2 changed files with 6 additions and 0 deletions

View file

@ -930,6 +930,9 @@ config NET_DEFAULT_IF_PPP
bool "PPP interface"
depends on NET_L2_PPP
config NET_DEFAULT_IF_OFFLOADED_NETDEV
bool "Offloaded network device"
config NET_DEFAULT_IF_WIFI
bool "WiFi interface"
depends on NET_L2_ETHERNET

View file

@ -632,6 +632,9 @@ struct net_if *net_if_get_default(void)
#if defined(CONFIG_NET_DEFAULT_IF_PPP)
iface = net_if_get_first_by_type(&NET_L2_GET_NAME(PPP));
#endif
#if defined(CONFIG_NET_DEFAULT_IF_OFFLOADED_NETDEV)
iface = net_if_get_first_by_type(&NET_L2_GET_NAME(OFFLOADED_NETDEV));
#endif
#if defined(CONFIG_NET_DEFAULT_IF_UP)
iface = net_if_get_first_up();
#endif