diff --git a/components/net/lwip/Kconfig b/components/net/lwip/Kconfig index fe019a3f724..374f4d565f8 100644 --- a/components/net/lwip/Kconfig +++ b/components/net/lwip/Kconfig @@ -213,6 +213,7 @@ if RT_USING_LWIP config RT_LWIP_NETIF_NAMESIZE int "netif name length" default 6 + range 3 32 config SO_REUSE int "Enable SO_REUSEADDR option" diff --git a/components/net/lwip/lwip-2.1.2/src/netif/ppp/ppp.c b/components/net/lwip/lwip-2.1.2/src/netif/ppp/ppp.c index 298bbc150e6..1b9f0d11169 100644 --- a/components/net/lwip/lwip-2.1.2/src/netif/ppp/ppp.c +++ b/components/net/lwip/lwip-2.1.2/src/netif/ppp/ppp.c @@ -469,8 +469,7 @@ static void ppp_do_connect(void *arg) { * ppp_netif_init_cb - netif init callback */ static err_t ppp_netif_init_cb(struct netif *netif) { - netif->name[0] = 'p'; - netif->name[1] = 'p'; + strncpy(netif->name, "pp", sizeof(netif->name)); #if PPP_IPV4_SUPPORT netif->output = ppp_netif_output_ip4; #endif /* PPP_IPV4_SUPPORT */