Skip to content

Commit

Permalink
net: support configuring offloaded network device as default interface
Browse files Browse the repository at this point in the history
Adds Kconfig option for making an offloaded network device the default
interface.

Signed-off-by: Daniel Mangum <[email protected]>
  • Loading branch information
hasheddan authored and kartben committed Jan 8, 2025
1 parent 6ab5c00 commit 2522bb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions subsys/net/ip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions subsys/net/ip/net_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2522bb0

Please sign in to comment.