From fa44cef27b0f7fd8438c249f2f405816069c339e Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Fri, 1 May 2015 00:49:19 +0200 Subject: [PATCH] PPP, L2TP, added configurable L2TP MRU using opt.h --- src/include/lwip/opt.h | 11 +++++++++++ src/netif/ppp/pppol2tp.c | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 5216e50e..9af4ad9d 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -2316,6 +2316,17 @@ #define PPP_MINMRU 128 /* No MRUs below this */ #endif +/** + * Default MTU and MRU for L2TP + * Default = 1500 - PPPoE(6) - PPP Protocol(2) - IPv4 header(20) - UDP Header(8) + * - L2TP Header(6) - HDLC Header(2) - PPP Protocol(2) - MPPE Header(2) - PPP Protocol(2) + */ +#if PPPOL2TP_SUPPORT +#ifndef PPPOL2TP_DEFMRU +#define PPPOL2TP_DEFMRU 1450 +#endif +#endif /* PPPOL2TP_SUPPORT */ + #ifndef MAXNAMELEN #define MAXNAMELEN 256 /* max length of hostname or name for auth */ #endif diff --git a/src/netif/ppp/pppol2tp.c b/src/netif/ppp/pppol2tp.c index 1514134b..7e8fbafe 100644 --- a/src/netif/ppp/pppol2tp.c +++ b/src/netif/ppp/pppol2tp.c @@ -285,13 +285,13 @@ static err_t pppol2tp_connect(ppp_pcb *ppp, void *ctx) { ppp_clear(ppp); lcp_wo = &ppp->lcp_wantoptions; - lcp_wo->mru = 1500; /* FIXME: MTU depends if we support IP fragmentation or not */ + lcp_wo->mru = PPPOL2TP_DEFMRU; lcp_wo->neg_asyncmap = 0; lcp_wo->neg_pcompression = 0; lcp_wo->neg_accompression = 0; lcp_ao = &ppp->lcp_allowoptions; - lcp_ao->mru = 1500; /* FIXME: MTU depends if we support IP fragmentation or not */ + lcp_ao->mru = PPPOL2TP_DEFMRU; lcp_ao->neg_asyncmap = 0; lcp_ao->neg_pcompression = 0; lcp_ao->neg_accompression = 0;