buglwIP - A Lightweight TCP/IP stack - Bugs: bug #29855, PPP: Backport a bugfix in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #29855: PPP: Backport a bugfix in LcpSendEchoRequest from pppd

Submitter:  Iordan Neshev <iordan_neshev>
Submitted:  Tue 11 May 2010 01:23:02 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  CVS Head

Tue 11 May 2010 04:55:07 PM UTC, comment #1: 

Done. I've compared it to pppd because I wondered why that changed - before that change, lcp_echos_pending was 0 after sending but now it is 1. Anyway, since the pppd guys changed it to that, I think we're better off changing it, too ;-)

Thanks for reporting.

Simon Goldschmidt <goldsimon>
Group administrator
Tue 11 May 2010 01:23:02 PM UTC, original submission:  

file: ppp/lpc.c
func: LcpSendEchoRequest (fsm *f)

The number of the pending echos we are waiting is currently (lwip code) incremented before an echo request is actually sent.
In the latest pppd the corresponding variable lcp_echos_pending
is incremeted after the request is really sent, so LcpSendEchoRequest() should look like this:

static void
LcpSendEchoRequest (fsm *f)
{
  u32_t lcp_magic;
  u_char pkt[4], *pktp;

  /*
   * Detect the failure of the peer at this point.
   */
  if (lcp_echo_fails != 0) {
    if (lcp_echos_pending >= lcp_echo_fails) {
      LcpLinkFailure(f);
      lcp_echos_pending = 0;
    }
  }

  /*
   * Make and send the echo request frame.
   */
  if (f->state == LS_OPENED) {
    lcp_magic = lcp_gotoptions[f->unit].magicnumber;
    pktp = pkt;
    PUTLONG(lcp_magic, pktp);
    fsm_sdata(f, ECHOREQ, (u_char)(lcp_echo_number++ & 0xFF), pkt, (int)(pktp - pkt));
    ++lcp_echos_pending;
  }
}

Thus bug has no harmful effects.

Iordan Neshev <iordan_neshev>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by iordan_neshev (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-05-11 goldsimon Item GroupNone Faulty Behaviour
        StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code