LWIP can't find output route

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

LWIP can't find output route

gzayzay
Hello All,

I am running LWIP 2.0.3 and I am running into one problem after another. I
have PPPoS running and connection has been established successfully. I
initiated a new PPP session with the following APIs (using the appropriate
pppapi variants where needed):

ppp = pppos_create(&ppp_netif, output_cb, status_cb, ctx_cb);
ppp_set_default(ppp);

The connection was established successfully and I have seen pings reaching
the device. However, LWIP is not sending a ping response. Somehow, it cannot
find the appropriate route for the interface when it is trying to send out
the reply and therefore, the data is discarded.

Have anyone encounter this problem who can help? Occasionally the interface
is found and the ping reply will go out. I was testing and saw that I will
ping the device, and after 2 to 3 pings, it will stop responding.

I notice that there is a function called ip4_route() in ip4.c where it seems
to be searching for network interface and can never find any match.

Any help will be highly appreciated

~Edman



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: LWIP can't find output route

Sergey A. Borshch
On 09.08.2018 13:30, gzayzay wrote:
> Hello All,
>
> I am running LWIP 2.0.3 and I am running into one problem after another. I
> have PPPoS running and connection has been established successfully. I
> initiated a new PPP session with the following APIs (using the appropriate
> pppapi variants where needed):
>
> ppp = pppos_create(&ppp_netif, output_cb, status_cb, ctx_cb);
> ppp_set_default(ppp);
Did you missed ppp_connect(ppp) after that?

--
Regards,
   Sergey A. Borshch            mailto: [hidden email]
     SB ELDI ltd. Riga, Latvia

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: LWIP can't find output route

gzayzay
This post was updated on .
No, I have all those included. I am fully connected to the network. The actual calls I am making are as follows

// Set this PPP interface  as the default network interface
 pppapi_set_default(lteCfgInfo.ppp.pppCtrlBlk);

// Ask the peer for up to 2 DNS server addresses.
ppp_set_usepeerdns(lteCfgInfo.ppp.pppCtrlBlk, 1);

// Authentication configuration, this is pretty self-explanatory
ppp_set_auth(lteCfgInfo.ppp.pppCtrlBlk, PPPAUTHTYPE_CHAP, pAuthUN, pAuthPwd);

lError = pppapi_connect(lteCfgInfo.ppp.pppCtrlBlk, holdOff);

if ( lError == ERR_OK )
{
       pppapi_set_notify_phase_callback(lteCfgInfo.ppp.pppCtrlBlk, ltePppPhaseNotifyCb);
       ppp_set_asyncmap(lteCfgInfo.ppp.pppCtrlBlk, 0);

     ....

}

--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: LWIP can't find output route

gzayzay
Ok, so I found the cause of the problem. For some reason, the netif list is
begin created and never NULL terminated. The linked list is next->netif
always have a copy of the PPP information. Therefore, when ip4_route(), it
has a "for" loop that is never terminating.

As a quick test, since I know I have one interface, by allowing the check
once, and getting out of the "for" loop, default route which has already
been populated with what was negotiated from the PPP session establishment
is used.

While this is not a full solution as I need to investigate why LWIP is not
appropriately setting the netif_list, this seems to be solving my problem
with the route issue for now and I hope LWIP team can also dig deeper into
this.

Not sure if this is a bug in LWIP. This code is in ip4.c in the function
ip4_route().

Edman



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users