Skip to content

Commit 8d077ca

Browse files
jukkarfabiobaltieri
authored andcommitted
net: if: Print warning if there are no network interfaces
When calling net_if_get_default(), print a warning if no network interfaces are found. This helps debugging mysterious crashes. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
1 parent 17f852f commit 8d077ca

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

subsys/net/ip/net_if.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ struct net_if *net_if_get_default(void)
579579
struct net_if *iface = NULL;
580580

581581
if (&_net_if_list_start[0] == &_net_if_list_end[0]) {
582+
NET_WARN("No default interface found!");
582583
return NULL;
583584
}
584585

0 commit comments

Comments
 (0)