Update of /cvsroot/leaf/src/bering-uclibc4/source/ppp
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26872

Modified Files:
        buildtool.cfg buildtool.mk 
Added Files:
        pppd-allow-mppe.patch 
Log Message:
Added 'allow-mppe-128' option that allows on-demand MPPE usage but doesn't 
force it.


--- NEW FILE: pppd-allow-mppe.patch ---
diff --git a/pppd/ccp.c b/pppd/ccp.c
index 5814f35..377c733 100644
--- a/pppd/ccp.c
+++ b/pppd/ccp.c
@@ -139,6 +139,9 @@ static option_t ccp_option_list[] = {
     { "require-mppe-128", o_bool, &ccp_allowoptions[0].mppe,
       "require MPPE 128-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
       &ccp_wantoptions[0].mppe },
+    { "allow-mppe-128", o_bool, &ccp_allowoptions[0].allow_mppe,
+      "require MPPE 128-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
+      &ccp_wantoptions[0].allow_mppe },
     { "+mppe-128", o_bool, &ccp_allowoptions[0].mppe,
       "require MPPE 128-bit encryption",
       OPT_ALIAS | OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
@@ -397,7 +400,7 @@ ccp_open(unit)
      * deciding whether to open in silent mode.
      */
     ccp_resetci(f);
-    if (!ANY_COMPRESS(ccp_gotoptions[unit]))
+    if (!ANY_COMPRESS(ccp_gotoptions[unit]) || ccp_gotoptions[unit].allow_mppe)
        f->flags |= OPT_SILENT;
 
     fsm_open(f);
@@ -1077,6 +1080,8 @@ ccp_reqci(f, p, lenp, dont_nak)
     int len, clen, type, nb;
     ccp_options *ho = &ccp_hisoptions[f->unit];
     ccp_options *ao = &ccp_allowoptions[f->unit];
+    ccp_options *go = &ccp_gotoptions[f->unit];
+    ccp_options *wo = &ccp_wantoptions[f->unit];
 #ifdef MPPE
     bool rej_for_ci_mppe = 1;  /* Are we rejecting based on a bad/missing */
                                /* CI_MPPE, or due to other options?       */
@@ -1103,11 +1108,22 @@ ccp_reqci(f, p, lenp, dont_nak)
            switch (type) {
 #ifdef MPPE
            case CI_MPPE:
-               if (!ao->mppe || clen != CILEN_MPPE) {
+               if (!(ao->mppe||ao->allow_mppe) || clen != CILEN_MPPE) {
                    newret = CONFREJ;
                    break;
                }
+               
                MPPE_CI_TO_OPTS(&p[2], ho->mppe);
+               
+               if (ao->allow_mppe && !ao->mppe && (ho->mppe&MPPE_OPT_128)){
+                   ao->mppe=ao->allow_mppe;
+                   go->mppe=go->allow_mppe;
+                   wo->mppe=wo->allow_mppe;
+                   ccp_resetci(f);
+                   /*ccp_down(f);
+                   ccp_up(f);
+                   return CONFACK;*/
+               }
 
                /* Nak if anything unsupported or unknown are set. */
                if (ho->mppe & MPPE_OPT_UNSUPPORTED) {
diff --git a/pppd/ccp.h b/pppd/ccp.h
index 6f4a2fe..7211c74 100644
--- a/pppd/ccp.h
+++ b/pppd/ccp.h
@@ -38,6 +38,7 @@ typedef struct ccp_options {
     bool deflate_correct;      /* use correct code for deflate? */
     bool deflate_draft;                /* use draft RFC code for deflate? */
     bool mppe;                 /* do MPPE? */
+    bool allow_mppe;                   /* do MPPE? */
     u_short bsd_bits;          /* # bits/code for BSD Compress */
     u_short deflate_size;      /* lg(window size) for Deflate */
     short method;              /* code for chosen compression method */
diff --git a/pppd/fsm.c b/pppd/fsm.c
index c200cc3..782dd0e 100644
--- a/pppd/fsm.c
+++ b/pppd/fsm.c
@@ -435,11 +435,11 @@ fsm_rconfreq(f, id, inp, len)
        f->state = REQSENT;
        break;
 
-    case STOPPED:
-       /* Negotiation started by our peer */
-       fsm_sconfreq(f, 0);             /* Send initial Configure-Request */
-       f->state = REQSENT;
-       break;
+//    case STOPPED:
+//     /* Negotiation started by our peer */
+//     fsm_sconfreq(f, 0);             /* Send initial Configure-Request */
+//     f->state = REQSENT;
+//     break;
     }
 
     /*
@@ -454,6 +454,11 @@ fsm_rconfreq(f, id, inp, len)
     else
        code = CONFACK;
 
+    if (f->state==STOPPED){
+       fsm_sconfreq(f, 0);             /* Send initial Configure-Request */
+       f->state = REQSENT;
+    }
+
     /* send the Ack, Nak or Rej to the peer */
     fsm_sdata(f, code, id, inp, len);
 

Index: buildtool.cfg
===================================================================
RCS file: /cvsroot/leaf/src/bering-uclibc4/source/ppp/buildtool.cfg,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** buildtool.cfg       6 Aug 2010 22:23:38 -0000       1.4
--- buildtool.cfg       13 Aug 2010 19:58:37 -0000      1.5
***************
*** 74,77 ****
--- 74,84 ----
  </File>
  
+ <File pppd-allow-mppe.patch>
+   Server = cvs4-sourceforge
+   Revision = HEAD
+   envname = PPP_PATCH8
+   Directory = ppp
+ </File>
+ 
  <File dsl-provider.atm>
    Server = cvs4-sourceforge
***************
*** 161,165 ****
        <ppp>
                Version = 2.4.5
!               Revision = 1
  
                Help <<EOF
--- 168,172 ----
        <ppp>
                Version = 2.4.5
!               Revision = 2
  
                Help <<EOF
***************
*** 196,200 ****
  
                Version = 2.4.5
!               Revision = 1
  
                Help <<EOF
--- 203,207 ----
  
                Version = 2.4.5
!               Revision = 2
  
                Help <<EOF
***************
*** 230,234 ****
        <pppoe>
                Version = 2.4.5
!               Revision = 1
  
                Help <<EOF
--- 237,241 ----
        <pppoe>
                Version = 2.4.5
!               Revision = 2
  
                Help <<EOF
***************
*** 273,277 ****
        <pppoatm>
                Version = 2.4.5
!               Revision = 1
  
                Help <<EOF
--- 280,284 ----
        <pppoatm>
                Version = 2.4.5
!               Revision = 2
  
                Help <<EOF
***************
*** 316,320 ****
        <ppp-rad>
                Version = 2.4.5
!               Revision = 1
  
                Help <<EOF
--- 323,327 ----
        <ppp-rad>
                Version = 2.4.5
!               Revision = 2
  
                Help <<EOF
***************
*** 381,385 ****
        <pppol2tp>
                Version = 0.13
!               Revision = 1
  
                Help <<EOF
--- 388,392 ----
        <pppol2tp>
                Version = 0.13
!               Revision = 2
  
                Help <<EOF

Index: buildtool.mk
===================================================================
RCS file: /cvsroot/leaf/src/bering-uclibc4/source/ppp/buildtool.mk,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** buildtool.mk        6 Aug 2010 22:23:38 -0000       1.3
--- buildtool.mk        13 Aug 2010 19:58:37 -0000      1.4
***************
*** 15,18 ****
--- 15,19 ----
        cat $(PPP_PATCH7) | patch -d $(PPP_DIR) -p1
        cat $(PPP_PATCH8) | patch -d $(PPP_DIR) -p1
+       cat $(PPP_PATCH9) | patch -d $(PPP_DIR) -p1
        touch $(PPP_DIR)/.source
  


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
leaf-cvs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/leaf-cvs-commits

Reply via email to