PPPoE is now guessing its MTU from the underlying netif MTU (in most cases 1500 minus 8 = 1492, which is the most common PPPoE MTU)

This commit is contained in:
Sylvain Rochet 2012-06-05 22:22:35 +02:00
parent 7d7513c71c
commit 2e227f868b
2 changed files with 2 additions and 9 deletions

View File

@ -133,13 +133,6 @@ PACK_STRUCT_END
#define PPPOE_CODE_PADS 0x65 /* Active Discovery Session confirmation */
#define PPPOE_CODE_PADT 0xA7 /* Active Discovery Terminate */
#ifndef ETHERMTU
#define ETHERMTU 1500
#endif
/* two byte PPP protocol discriminator, then IP data */
#define PPPOE_MAXMTU (ETHERMTU-PPPOE_HEADERLEN-2)
#ifndef PPPOE_MAX_AC_COOKIE_LEN
#define PPPOE_MAX_AC_COOKIE_LEN 64
#endif

View File

@ -609,12 +609,12 @@ int ppp_over_ethernet_open(struct netif *ethif, const char *service_name, const
pc->link_status_cb = link_status_cb;
pc->link_status_ctx = link_status_ctx;
lcp_wantoptions[pd].mru = PPPOE_MAXMTU;
lcp_wantoptions[pd].mru = ethif->mtu-PPPOE_HEADERLEN-2; /* two byte PPP protocol discriminator, then IP data */
lcp_wantoptions[pd].neg_asyncmap = 0;
lcp_wantoptions[pd].neg_pcompression = 0;
lcp_wantoptions[pd].neg_accompression = 0;
lcp_allowoptions[pd].mru = PPPOE_MAXMTU;
lcp_allowoptions[pd].mru = ethif->mtu-PPPOE_HEADERLEN-2; /* two byte PPP protocol discriminator, then IP data */
lcp_allowoptions[pd].neg_asyncmap = 0;
lcp_allowoptions[pd].neg_pcompression = 0;
lcp_allowoptions[pd].neg_accompression = 0;