RHEL: TCP_MAXSEG in setsockopt() does not appear to have any effect
Issue
- We are changing the TCP_MAXSEG size in a socket in our C program, like this:
n = setsockopt(sockfd, IPPROTO_TCP, TCP_MAXSEG, &requested_mss, sizeof(requested_mss));
- We then retrieve it here:
getsockopt(sockfd, IPPROTO_TCP, TCP_MAXSEG, &actual_mss, &actual_mss_len)
- And actual_mss is always 1448, no matter if we make requested_mss 500, or 5000, or whatever. It also doesn't matter if we run the program as root.
- Can the the MMS be changed after the connection is already established?
- No the MSS is part of the TCP options which are negotiated via the initial 3 way handshake.
Environment
- Red Hat Enterprise Linux
- TCP
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.