]> git.ozlabs.org Git - ppp.git/commitdiff
added receive-all option.
authorPaul Mackerras <paulus@samba.org>
Fri, 19 Mar 1999 01:24:57 +0000 (01:24 +0000)
committerPaul Mackerras <paulus@samba.org>
Fri, 19 Mar 1999 01:24:57 +0000 (01:24 +0000)
ignore extra unrecognized options in nak.

pppd/lcp.c
pppd/pppd.8

index e1c017b30b4f8ee8f11a0fcd2cb534f458b8468d..1ee727fa0fe2f4b51d60793e9a9d079f8c9e7d49 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: lcp.c,v 1.36 1999/03/16 22:54:41 paulus Exp $";
+static char rcsid[] = "$Id: lcp.c,v 1.37 1999/03/19 01:24:56 paulus Exp $";
 #endif
 
 /*
 #endif
 
 /*
@@ -40,6 +40,7 @@ static char rcsid[] = "$Id: lcp.c,v 1.36 1999/03/16 22:54:41 paulus Exp $";
  */
 int    lcp_echo_interval = 0;  /* Interval between LCP echo-requests */
 int    lcp_echo_fails = 0;     /* Tolerance to unanswered echo-requests */
  */
 int    lcp_echo_interval = 0;  /* Interval between LCP echo-requests */
 int    lcp_echo_fails = 0;     /* Tolerance to unanswered echo-requests */
+bool   lax_recv = 0;           /* accept control chars in asyncmap */
 
 static int setescape __P((char **));
 
 
 static int setescape __P((char **));
 
@@ -104,6 +105,8 @@ static option_t lcp_option_list[] = {
       "Set maximum number of LCP configure-request transmissions" },
     { "lcp-max-failure", o_int, &lcp_fsm[0].maxnakloops,
       "Set limit on number of LCP configure-naks" },
       "Set maximum number of LCP configure-request transmissions" },
     { "lcp-max-failure", o_int, &lcp_fsm[0].maxnakloops,
       "Set limit on number of LCP configure-naks" },
+    { "receive-all", o_bool, &lax_recv,
+      "Accept all received control characters", 1 },
     {NULL}
 };
 
     {NULL}
 };
 
@@ -117,7 +120,7 @@ u_int32_t xmit_accm[NUM_PPP][8];            /* extended transmit ACCM */
 
 static u_int32_t lcp_echos_pending = 0;        /* Number of outstanding echo msgs */
 static u_int32_t lcp_echo_number   = 0;        /* ID number of next echo frame */
 
 static u_int32_t lcp_echos_pending = 0;        /* Number of outstanding echo msgs */
 static u_int32_t lcp_echo_number   = 0;        /* ID number of next echo frame */
-static u_int32_t lcp_echo_timer_running = 0;  /* TRUE if a timer is running */
+static u_int32_t lcp_echo_timer_running = 0;  /* set if a timer is running */
 
 static u_char nak_buffer[PPP_MRU];     /* where we construct a nak packet */
 
 
 static u_char nak_buffer[PPP_MRU];     /* where we construct a nak packet */
 
@@ -365,7 +368,7 @@ lcp_lowerup(unit)
      */
     ppp_set_xaccm(unit, xmit_accm[unit]);
     ppp_send_config(unit, PPP_MRU, 0xffffffff, 0, 0);
      */
     ppp_set_xaccm(unit, xmit_accm[unit]);
     ppp_send_config(unit, PPP_MRU, 0xffffffff, 0, 0);
-    ppp_recv_config(unit, PPP_MRU, 0xffffffff,
+    ppp_recv_config(unit, PPP_MRU, (lax_recv? 0: 0xffffffff),
                    wo->neg_pcompression, wo->neg_accompression);
     peer_mru[unit] = PPP_MRU;
     lcp_allowoptions[unit].asyncmap = xmit_accm[unit][0];
                    wo->neg_pcompression, wo->neg_accompression);
     peer_mru[unit] = PPP_MRU;
     lcp_allowoptions[unit].asyncmap = xmit_accm[unit][0];
@@ -1044,12 +1047,9 @@ lcp_nakci(f, p, len)
        p = next;
     }
 
        p = next;
     }
 
-    /* If there is still anything left, this packet is bad. */
-    if (len != 0)
-       goto bad;
-
     /*
      * OK, the Nak is good.  Now we can update state.
     /*
      * OK, the Nak is good.  Now we can update state.
+     * If there are any options left we ignore them.
      */
     if (f->state != OPENED) {
        if (looped_back) {
      */
     if (f->state != OPENED) {
        if (looped_back) {
@@ -1551,7 +1551,7 @@ lcp_up(f)
                    (ho->neg_asyncmap? ho->asyncmap: 0xffffffff),
                    ho->neg_pcompression, ho->neg_accompression);
     ppp_recv_config(f->unit, (go->neg_mru? MAX(wo->mru, go->mru): PPP_MRU),
                    (ho->neg_asyncmap? ho->asyncmap: 0xffffffff),
                    ho->neg_pcompression, ho->neg_accompression);
     ppp_recv_config(f->unit, (go->neg_mru? MAX(wo->mru, go->mru): PPP_MRU),
-                   (go->neg_asyncmap? go->asyncmap: 0xffffffff),
+                   (lax_recv? 0: go->neg_asyncmap? go->asyncmap: 0xffffffff),
                    go->neg_pcompression, go->neg_accompression);
 
     if (ho->neg_mru)
                    go->neg_pcompression, go->neg_accompression);
 
     if (ho->neg_mru)
index b4bbdb035e5798114657d896fd81bb7e0ad26bdb..04d60c3b56a151848589ea467ae6561e27a6ad31 100644 (file)
@@ -1,5 +1,5 @@
 .\" manual page [] for pppd 2.3
 .\" manual page [] for pppd 2.3
-.\" $Id: pppd.8,v 1.34 1999/03/12 06:07:19 paulus Exp $
+.\" $Id: pppd.8,v 1.35 1999/03/19 01:24:57 paulus Exp $
 .\" SH section heading
 .\" SS subsection heading
 .\" LP paragraph
 .\" SH section heading
 .\" SS subsection heading
 .\" LP paragraph
@@ -628,6 +628,12 @@ with the IP address of the peer and the Ethernet address of this
 system.  This will have the effect of making the peer appear to other
 systems to be on the local ethernet.
 .TP
 system.  This will have the effect of making the peer appear to other
 systems to be on the local ethernet.
 .TP
+.B receive-all
+With this option, pppd will accept all control characters from the
+peer, including those marked in the receive asyncmap.  Without this
+option, pppd will discard those characters as specified in RFC1662.
+This option should only be needed if the peer is buggy.
+.TP
 .B remotename \fIname
 Set the assumed name of the remote system for authentication purposes
 to \fIname\fR.
 .B remotename \fIname
 Set the assumed name of the remote system for authentication purposes
 to \fIname\fR.