Subject: ppp_mppe pkg vs /sys/net/if_ppp.c
To: None <current-users@netbsd.org>
From: Paul Dokas <dokas@cthulhu.cs.umn.edu>
List: current-users
Date: 02/19/2001 14:21:53
I've been struggling to get the poptop + ppp-mppe packages
working correctly under -current so that a few Win2K laptops
can use pptp to access behind a firewall.  The problem that
I've been having is whenever I attempt to connect to the NetBSD
machine via pptp, I get endless streams of this:

  ppp/mppe: compress rejected: opt_len=32,o[0]=12,o[1]=6
  ppp/mppe: try increasing CCP_MAX_OPTION_LENGTH in ppp-comp.h


I think that I've tracked down the reason.


In the ppp-mppe package the LKM that gets built does not include
if_ppp.c that is found in the package.  Instead, it relies on
the if_ppp.c that is found in /sys/net/if_ppp.c which includes
the following lines:

line 384:
    u_char ccp_option[CCP_MAX_OPTION_LENGTH];

line 450-451:
        if (nb > sizeof(ccp_option))
            nb = sizeof(ccp_option);

and /sys/net/ppp-comp.h has this #define:

line 111-114:
/* 
 * Max # bytes for a CCP option 
 */
#define CCP_MAX_OPTION_LENGTH   32



However, in ppp-comp.h is found in the ppp-mppe package, this
#define is:

#define CCP_MAX_OPTION_LENGTH   64



So, Win2k sends a CCP option of length > 32, NetBSD's if_ppp.c
truncates it to 32 bytes and the rest ceases to function.


I see two solutions:

  1) change the #define of CCP_MAX_OPTION_LENGTH to 64 in
     /sys/net/ppp-comp.h

  2) put the version of if_ppp.c found in the ppp-mppe pkg
     into the LKM that it builds.

Speaking from a completely naive position WRT ppp and BSD networking,
I'd prefer solution #1, however, the diffs between /sys/net/if_ppp.c
and if_ppp.c in ppp-mppe are not simple to resolve.  There's probably
some code in the ppp-mppe version is might be required for MPPE to
work properly.

Paul
--
Paul Dokas                                            dokas@cs.umn.edu
======================================================================
Don Juan Matus:  "an enigma wrapped in mystery wrapped in a tortilla."