From a5337af48478865e1e7b4d3aef6adb1895ede7b9 Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Thu, 6 May 2021 21:52:48 +0800 Subject: [PATCH] nsh/telnetd: bringup the network before telnetd init bringup the network before telnetd init if without NSH_CONSOLE Signed-off-by: chao.an --- nshlib/nsh_telnetd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nshlib/nsh_telnetd.c b/nshlib/nsh_telnetd.c index 9105e2377..05159931e 100644 --- a/nshlib/nsh_telnetd.c +++ b/nshlib/nsh_telnetd.c @@ -47,6 +47,7 @@ #include +#include "netutils/netinit.h" #include "netutils/telnetd.h" #ifdef CONFIG_TELNET_CHARACTER_MODE @@ -266,6 +267,12 @@ int nsh_telnetstart(sa_family_t family) nsh_initscript(vtbl); #endif +#if defined(CONFIG_NSH_NETINIT) && !defined(CONFIG_NSH_CONSOLE) + /* Bring up the network */ + + netinit_bringup(); +#endif + /* Perform architecture-specific final-initialization(if configured) */ #if defined(CONFIG_NSH_ARCHINIT) && \