net/tcp: Set the default TCP MSS to the value required by RFC 879 and never change it under any circumstance unless the remote host requests a larger MSS via an option the TCP header.

This commit is contained in:
Gregory Nutt
2018-07-05 10:54:45 -06:00
parent f39c611d64
commit 73c4b1610b
4 changed files with 32 additions and 46 deletions
+2 -2
View File
@@ -343,8 +343,8 @@ void tcp_initialize(void);
* Description:
* Find a free TCP/IP connection structure and allocate it
* for use. This is normally something done by the implementation of the
* socket() API but is also called from the driver level when a TCP
* packet is received while "listening"
* socket() API but is also called from the event processing logic when a
* TCP packet is received while "listening"
*
****************************************************************************/
+1 -1
View File
@@ -613,7 +613,7 @@ void tcp_initialize(void)
* Description:
* Find a free TCP/IP connection structure and allocate it
* for use. This is normally something done by the implementation of the
* socket() API but is also called from the even procressing lock when a
* socket() API but is also called from the event processing logic when a
* TCP packet is received while "listening"
*
****************************************************************************/
+1 -26
View File
@@ -264,36 +264,11 @@ static uint16_t psock_connect_eventhandler(FAR struct net_driver_s *dev,
psock_teardown_callbacks(pstate, pstate->tc_result);
/* When we set up the connection structure, we did not know the size
* of the initial MSS. Now that the connection is associated with a
* network device, we now know the size of link layer header and can
* determine the correct initial MSS.
*/
DEBUGASSERT(pstate->tc_conn);
#ifdef CONFIG_NET_IPv4
#ifdef CONFIG_NET_IPv6
if (pstate->tc_conn->domain == PF_INET)
#endif
{
pstate->tc_conn->mss = TCP_IPv4_INITIAL_MSS(dev);
}
#endif /* CONFIG_NET_IPv4 */
#ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_IPv4
else
#endif
{
pstate->tc_conn->mss = TCP_IPv6_INITIAL_MSS(dev);
}
#endif /* CONFIG_NET_IPv6 */
/* We now have to filter all outgoing transfers so that they use only
* the MSS of this device.
*/
DEBUGASSERT(pstate->tc_conn != NULL);
DEBUGASSERT(pstate->tc_conn->dev == NULL ||
pstate->tc_conn->dev == dev);
pstate->tc_conn->dev = dev;