From ec1d866f76a1f910aedb2399809c094c869a2b95 Mon Sep 17 00:00:00 2001 From: jishengruofou Date: Thu, 8 Jan 2026 09:16:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9ppp=5Fnetdev=5Fadd?= =?UTF-8?q?=E4=B8=AD=E5=85=88=E4=BD=BF=E7=94=A8ppp=5Fdevice->pppif.name?= =?UTF-8?q?=EF=BC=8C=E5=90=8E=E6=89=8D=E8=B5=8B=E5=80=BC=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ppp_device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ppp_device.c b/src/ppp_device.c index ffabe59..4226e0b 100644 --- a/src/ppp_device.c +++ b/src/ppp_device.c @@ -371,12 +371,13 @@ static rt_err_t ppp_device_open(struct rt_device *device, rt_uint16_t oflag) goto __exit; } LOG_D("pppapi_pppos_create has created a protocol control block."); - ppp_netdev_add(&ppp_device->pppif); - + /* set netif name */ ppp_device->pppif.name[0] = ppp_device->parent.parent.name[0]; ppp_device->pppif.name[1] = ppp_device->parent.parent.name[1]; + ppp_netdev_add(&ppp_device->pppif); + if (result != RT_EOK) { LOG_E("pppapi_set_default execute failed."); From 44e9f8624b8bcbad3e25bc032e0631b0b8945023 Mon Sep 17 00:00:00 2001 From: jishengruofou Date: Thu, 8 Jan 2026 16:39:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A0=E9=99=A4result?= =?UTF-8?q?=20=3D=20pppapi=5Fset=5Fdefault(ppp=5Fdevice->pcb);=E5=90=8E?= =?UTF-8?q?=E5=AF=B9result=E7=9A=84=E5=88=A4=E6=96=AD=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ppp_device.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/ppp_device.c b/src/ppp_device.c index 4226e0b..f72c69b 100644 --- a/src/ppp_device.c +++ b/src/ppp_device.c @@ -378,14 +378,6 @@ static rt_err_t ppp_device_open(struct rt_device *device, rt_uint16_t oflag) ppp_netdev_add(&ppp_device->pppif); - if (result != RT_EOK) - { - LOG_E("pppapi_set_default execute failed."); - result = -RT_ERROR; - goto __exit; - } - LOG_D("pppapi_set_default has set a default route."); - /* dns */ ppp_set_usepeerdns(ppp_device->pcb, 1); LOG_D("ppp_set_usepeerdns has set a dns number.");