Implemented calculating the effective send-mss based on the MTU of the netif used to send. Enabled by default. Disable by setting LWIP_CALCULATE_EFF_SEND_MSS to 0. This fixes bug #21535.

This commit is contained in:
goldsimon
2007-11-21 18:37:23 +00:00
parent dc515c7ad3
commit 95425552d7
5 changed files with 58 additions and 0 deletions

View File

@@ -636,11 +636,27 @@
/**
* TCP_MSS: TCP Maximum segment size. (default is 128, a *very*
* conservative default.)
* For the receive side, this MSS is advertised to the remote side
* when opening a connection. For the transmit size, this MSS sets
* an upper limit on the MSS advertised by the remote host.
*/
#ifndef TCP_MSS
#define TCP_MSS 128
#endif
/**
* LWIP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
* sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
* reflects the available reassembly buffer size at the remote host) and the
* largest size permitted by the IP layer" (RFC 1122)
* Setting this to 1 enables code that checks TCP_MSS against the MTU of the
* netif used for a connection and limits the MSS it would be too big otherwise.
*/
#ifndef LWIP_CALCULATE_EFF_SEND_MSS
#define LWIP_CALCULATE_EFF_SEND_MSS 1
#endif
/**
* TCP_SND_BUF: TCP sender buffer space (bytes).
*/

View File

@@ -508,6 +508,10 @@ u32_t tcp_next_iss(void);
void tcp_keepalive(struct tcp_pcb *pcb);
#if LWIP_CALCULATE_EFF_SEND_MSS
u16_t tcp_eff_send_mss(u16_t sendmss, struct ip_addr *addr);
#endif /* LWIP_CALCULATE_EFF_SEND_MSS*/
extern struct tcp_pcb *tcp_input_pcb;
extern u32_t tcp_ticks;