Correct the MSS calculation

This commit is contained in:
Gregory Nutt 2015-01-22 12:30:07 -06:00
parent 1c8dae4eee
commit 9f40a13cfa

View File

@ -322,7 +322,7 @@
#define TCP_MAXSYNRTX 5 #define TCP_MAXSYNRTX 5
/* The TCP maximum segment size. This is should not be set to more /* The TCP maximum segment size. This is should not be set to more
* than NET_DEV_MTU(dev) - NET_LL_HDRLEN(dev) - IPv4TCP_HDRLEN. * than NET_DEV_MTU(dev) - NET_LL_HDRLEN(dev) - IPvN_HDRLEN - TCP_HDRLEN.
* *
* In the case where there are multiple network devices with different * In the case where there are multiple network devices with different
* link layer protocols (CONFIG_NET_MULTILINK), each network device * link layer protocols (CONFIG_NET_MULTILINK), each network device
@ -330,7 +330,7 @@
* the minimum MSS for that case. * the minimum MSS for that case.
*/ */
#define TCP_MSS(d,h) (NET_DEV_MTU(d) - NET_LL_HDRLEN(d) - (h)) #define TCP_MSS(d,h) (NET_DEV_MTU(d) - NET_LL_HDRLEN(d) - TCP_HDRLEN - (h))
/* If Ethernet is supported, then it will have the smaller MSS */ /* If Ethernet is supported, then it will have the smaller MSS */