Don't override the user's choice of mtu/mru < 1492,
authorPaul Mackerras <paulus@samba.org>
Thu, 25 Aug 2005 10:51:27 +0000 (10:51 +0000)
committerPaul Mackerras <paulus@samba.org>
Thu, 25 Aug 2005 10:51:27 +0000 (10:51 +0000)
and don't warn about the fact that pppoe can't do mru=1500.

pppd/plugins/rp-pppoe/plugin.c

index 1ea46a65efdedcca71b2aecda3b6e2177bf953ba..1e9bd83152bbf8b8a54f64aecb5ef027203d81e4 100644 (file)
@@ -22,7 +22,7 @@
 ***********************************************************************/
 
 static char const RCSID[] =
-"$Id: plugin.c,v 1.13 2005/07/09 09:12:48 paulus Exp $";
+"$Id: plugin.c,v 1.14 2005/08/25 10:51:27 paulus Exp $";
 
 #define _GNU_SOURCE 1
 #include "pppoe.h"
@@ -187,8 +187,10 @@ PPPOERecvConfig(int mru,
                int pcomp,
                int accomp)
 {
+#if 0 /* broken protocol, but no point harrassing the users I guess... */
     if (mru > MAX_PPPOE_MTU)
        warn("Couldn't increase MRU to %d", mru);
+#endif
 }
 
 /**********************************************************************
@@ -294,27 +296,6 @@ PPPoEDevnameHook(char *cmd, char **argv, int doit)
            the_channel = &pppoe_channel;
            modem = 0;
 
-           lcp_allowoptions[0].neg_accompression = 0;
-           lcp_wantoptions[0].neg_accompression = 0;
-
-           lcp_allowoptions[0].neg_asyncmap = 0;
-           lcp_wantoptions[0].neg_asyncmap = 0;
-
-           lcp_allowoptions[0].neg_pcompression = 0;
-           lcp_wantoptions[0].neg_pcompression = 0;
-
-           lcp_allowoptions[0].mru = MAX_PPPOE_MTU;
-           lcp_wantoptions[0].mru = MAX_PPPOE_MTU;
-
-           ccp_allowoptions[0].deflate = 0 ;
-           ccp_wantoptions[0].deflate = 0 ;
-
-           ipcp_allowoptions[0].neg_vj=0;
-           ipcp_wantoptions[0].neg_vj=0;
-
-           ccp_allowoptions[0].bsd_compress = 0;
-           ccp_wantoptions[0].bsd_compress = 0;
-
            PPPOEInitDevice();
        }
        return 1;
@@ -399,11 +380,36 @@ sysErr(char const *str)
     rp_fatal(str);
 }
 
+void pppoe_check_options(void)
+{
+    lcp_allowoptions[0].neg_accompression = 0;
+    lcp_wantoptions[0].neg_accompression = 0;
+
+    lcp_allowoptions[0].neg_asyncmap = 0;
+    lcp_wantoptions[0].neg_asyncmap = 0;
+
+    lcp_allowoptions[0].neg_pcompression = 0;
+    lcp_wantoptions[0].neg_pcompression = 0;
+
+    if (lcp_allowoptions[0].mru > MAX_PPPOE_MTU)
+       lcp_allowoptions[0].mru = MAX_PPPOE_MTU;
+    if (lcp_wantoptions[0].mru > MAX_PPPOE_MTU)
+       lcp_wantoptions[0].mru = MAX_PPPOE_MTU;
+
+    ccp_allowoptions[0].deflate = 0;
+    ccp_wantoptions[0].deflate = 0;
+
+    ipcp_allowoptions[0].neg_vj = 0;
+    ipcp_wantoptions[0].neg_vj = 0;
+
+    ccp_allowoptions[0].bsd_compress = 0;
+    ccp_wantoptions[0].bsd_compress = 0;
+}
 
 struct channel pppoe_channel = {
     options: Options,
     process_extra_options: &PPPOEDeviceOptions,
-    check_options: NULL,
+    check_options: pppoe_check_options,
     connect: &PPPOEConnectDevice,
     disconnect: &PPPOEDisconnectDevice,
     establish_ppp: &generic_establish_ppp,