Commit 5e6a3ce6 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

tcp: Report mss_clamp with TCP_MAXSEG option in repair mode

The mss_clamp is the only connection-time negotiated option which
cannot be obtained from the user space. Make the TCP_MAXSEG sockopt
report one in the repair mode.
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c0e88ff0
...@@ -2659,6 +2659,8 @@ static int do_tcp_getsockopt(struct sock *sk, int level, ...@@ -2659,6 +2659,8 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
val = tp->mss_cache; val = tp->mss_cache;
if (!val && ((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN))) if (!val && ((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN)))
val = tp->rx_opt.user_mss; val = tp->rx_opt.user_mss;
if (tp->repair)
val = tp->rx_opt.mss_clamp;
break; break;
case TCP_NODELAY: case TCP_NODELAY:
val = !!(tp->nonagle&TCP_NAGLE_OFF); val = !!(tp->nonagle&TCP_NAGLE_OFF);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment