On 3/13/24 12:37, Stefano Brivio wrote:
On Mon, 11 Mar 2024 14:33:56 +0100 Laurent Vivier
wrote:
...
diff --git a/tcp.c b/tcp.c index d5eedf4d0138..5c8488108ef7 100644 --- a/tcp.c +++ b/tcp.c @@ -318,39 +318,7 @@ ... -#define MSS4 ROUND_DOWN(USHRT_MAX - sizeof(struct tcp4_l2_head), 4) -#define MSS6 ROUND_DOWN(USHRT_MAX - sizeof(struct tcp6_l2_head), 4)
+#define MSS (USHRT_MAX - sizeof(struct tcphdr))
We can't exceed USHRT_MAX at Layer-2 level, though, so the MSS for IPv4 should now be:
#define MSS4 ROUND_DOWN(USHRT_MAX - sizeof(struct ethhdr) - sizeof(struct iphdr) - sizeof(struct tcphdr), 4)
...and similar for IPv6.
Is there a specification that limits the MSS? Or is it only a compatibility problem with the network stack implementation? At headers level the only limitation we have is the length field size in the IP header that is a 16bit (it's why I put "USHRT_MAX - sizeof(struct tcphdr)"). Thanks, Laurent