From 90874392e330e6c6bf552b349a8ae176708595c2 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 18 Oct 2020 23:30:58 +0200 Subject: [PATCH] PPP: force default MRU to 1500 RFC1661 mandates that default MRU value, that must be used prior negotiation of MRU value and if MRU value is not negotiated later, must be 1500. That is, any PPP host must accept control frames of at least 1500 when the PPP session start (there are no way to split them in multiples frames anyway) and must use a value of 1500 if MRU is no negotiated during LCP exchanges. Therefore, having it configurable in ppp_opts is a mistake. It was wrong and never worked because changing the value never triggered a MRU value negotiation because it changed both the wanted MRU value and the RFC default value to which the wanted value is compared to trigger a MRU negotiation if values are not equal. --- src/include/netif/ppp/ppp_impl.h | 6 ++++++ src/include/netif/ppp/ppp_opts.h | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/include/netif/ppp/ppp_impl.h b/src/include/netif/ppp/ppp_impl.h index 56a29a54..b149c132 100644 --- a/src/include/netif/ppp/ppp_impl.h +++ b/src/include/netif/ppp/ppp_impl.h @@ -81,6 +81,12 @@ extern "C" { #define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ #define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ +/* + * PPP_DEFMRU: MRU value used prior negotiation and unless negotiated later. + * Must be 1500. + */ +#define PPP_DEFMRU 1500 + /* * Protocol field values. */ diff --git a/src/include/netif/ppp/ppp_opts.h b/src/include/netif/ppp/ppp_opts.h index dfe988cc..8fe4a3ee 100644 --- a/src/include/netif/ppp/ppp_opts.h +++ b/src/include/netif/ppp/ppp_opts.h @@ -501,13 +501,6 @@ #define PPP_MRU 1500 #endif -/** - * PPP_DEFMRU: Default MRU to try - */ -#ifndef PPP_DEFMRU -#define PPP_DEFMRU 1500 -#endif - /** * PPP_MAXMRU: Normally limit MRU to this (pppd default = 16384) */