RHEL: TCP_MAXSEG in setsockopt() does not appear to have any effect

Solution In Progress - Updated -

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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.