lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] PPP - TCP


From: Norberto R. de Goes Jr.
Subject: Re: [lwip-users] PPP - TCP
Date: Mon, 18 Jan 2016 08:14:17 -0200

Hi Sylvain.

I changed the "simhost.c" file to use the pppos_input_sys function (attached full file) conforming your orientation.
"...
  while(1) {
      sizeRead = sio_read(ppp->ppp_sio, buffer, 1000);
      if (sizeRead > 0) {
         /* struct pbuf *pBuffer = pbuf_alloc(PBUF_LINK, sizeRead, PBUF_RAM); */
         struct pbuf *pBuffer = pbuf_alloc(PBUF_RAW, sizeRead, PBUF_POOL);

          if (pBuffer == NULL) {
              printf("Allocate memory fail.\n");
              return;
          }
          MEMCPY(pBuffer->payload, buffer, sizeRead);
          pppos_input_sys(pBuffer, &pppos_netif);
      }
  }
..."

But unfortunately the behavior is the same. Please, do you have any sugestion?
Thanks.

Norberto



2016-01-16 19:00 GMT-02:00 Sylvain Rochet <address@hidden>:
Hi Norberto,

On Fri, Jan 15, 2016 at 03:35:06PM -0200, Norberto R. de Goes Jr. wrote:
> Hi Sylvain.
>
> How I told you, I am facing problems with TCP-PPP in lwip scenario.
> Then I decided use just a raw lwip code to reproduce the problem and, if it
> is possible, could you use it to reproduce in your environment.
>
> I fetched my git repositoy today (15/jan). Hashs:
>   - lwip:               e033866651903f4b12e6af074180272c5aadc553
>   - lwip-contrib:  ddff8d34d0e7e5f417926aed032067e75c28a447
>
> and I changed a little bit two files (attached).
>   - ports/unix/proj/unixsim/lwipopts.h
>   - ports/unix/proj/unixsim/simhost.c
>
> The "simhost" then was compiled using the original makefile:
>   > cd .../lwip-contrib/ports/unix/proj/unixsim
>   > make
>
> I have two VM´s (Ubuntu) in a Win-7 server. In the VM#1, I run the pppd
> (linux), passive mode. Just after, the simhost app is executed in VM#2.
> The link ppp is established, with no problem.
>
> The simhost already implements a TCP echo server (reply). At VM#1, the echo
> client app (use the TCP linux stack, no lwip) is executed. The TCP
> connection is established.
>
> After 3 or 4 string messages exchanged the lwip reports error and the TCP
> connection going to down. The client reports "Resource temporarily
> unavailable" and  the simhost app sometimes shut down.
>
> I apologize for my insistence, but we are in great need of a help.
> Thanks.

From a quick look on what you changed in the unixsim project, the added
ppp_loop_thread() function is using the lwIP PPP raw API, which is not
thread safe.

Please try using pppos_input_sys() instead of pppos_input(). FYI that's
properly documented into lwip/doc/ppp.txt, section "3 PPPoS input path
(raw API, IRQ safe API, TCPIP API)".

Sylvain

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users



--
Norberto R. de Goes Jr.
CPqD - DRC
Tel.: +55 19 3705-4241 / Fax: +55 19 3705-6125
address@hidden
www.cpqd.com.br


Attachment: simhost.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]