Subject: ppp problem/question
To: Dave Huang <khym@bga.com>
From: Stephen Ma <Stephen.Ma@jtec.com.au>
List: tech-net
Date: 09/04/1997 21:52:52
[shifted this thread to tech-net, where it belongs]

Dave> I was trying to get a PPP connection going with a cisco terminal
Dave> server, and this stuff started happening:

[following trace somewhat edited]

Dave> sent [LCP ConfReq id=0x1 <mru 552>]
Dave> rcvd [LCP ConfNak id=0x1 <mru 1500>]
Dave> sent [LCP ConfReq id=0x2 <mru 552>]
Dave> rcvd [LCP ConfNak id=0x2 <mru 1500>]
Dave> [ repeats a couple of times ]

Dave> So, is it right for pppd to be doing that? I have "mru 552" in
Dave> my options file, but I thought that meant "ask for 552, but I'll
Dave> take what I can get", not "insist on 552 and refuse to play if I
Dave> can't have it". I thought that was the point of all this fancy
Dave> PPP options negotiation :)

Ummmm... From a brief scan of /usr/src/usr.sbin/pppd/pppd/lcp.c, in
function lcp_nakci(), there's a chunk of code which handles the
incoming nak:

    /*
     * We don't care if they want to send us smaller packets than
     * we want.  Therefore, accept any MRU less than what we asked for,
     * but then ignore the new value when setting the MRU in the kernel.
     * If they send us a bigger MRU than what we asked, accept it, up to
     * the limit of the default MRU we'd get if we didn't negotiate.
     */
    if (go->neg_mru && go->mru != DEFMRU) {
        NAKCISHORT(CI_MRU, neg_mru,
                   if (cishort <= wo->mru || cishort < DEFMRU)
                       try.mru = cishort;
                   );
    }

Note that DEFMRU is 1500.

At a VERY rough guess, it's ignoring the nak from the remote end
because the the MRU requested by the remote end is equal to 1500 (and
not strictly less than). I believe this is a bug - it should happily
accept the default MRU.

Try the attached patch file. (no guarantees).

- S

*** /usr/src/usr.sbin/pppd/pppd/lcp.c	Sun May 18 21:27:56 1997
--- lcp.c	Thu Sep  4 21:39:49 1997
***************
*** 791,797 ****
       */
      if (go->neg_mru && go->mru != DEFMRU) {
  	NAKCISHORT(CI_MRU, neg_mru,
! 		   if (cishort <= wo->mru || cishort < DEFMRU)
  		       try.mru = cishort;
  		   );
      }
--- 791,797 ----
       */
      if (go->neg_mru && go->mru != DEFMRU) {
  	NAKCISHORT(CI_MRU, neg_mru,
! 		   if (cishort <= wo->mru || cishort <= DEFMRU)
  		       try.mru = cishort;
  		   );
      }