summaryrefslogtreecommitdiff
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2017-02-02 08:04:56 -0800
committerDavid S. Miller <davem@davemloft.net>2017-02-03 11:19:34 -0500
commit3541f9e8bdebce02458882b66b638d7302c1f616 (patch)
tree1049ef01f68f197e66fa77f18768aaf6d219f8b1 /net/ipv6/tcp_ipv6.c
parentff3edc9b8efc8200c25f3a5adfb1c1de0a882dc5 (diff)
downloadlinux-rpi-3541f9e8bdebce02458882b66b638d7302c1f616.tar.gz
linux-rpi-3541f9e8bdebce02458882b66b638d7302c1f616.tar.bz2
linux-rpi-3541f9e8bdebce02458882b66b638d7302c1f616.zip
tcp: add tcp_mss_clamp() helper
Small cleanup factorizing code doing the TCP_MAXSEG clamping. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 64834ec5ab73..6b9fc63fd4d2 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1147,10 +1147,7 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
tcp_ca_openreq_child(newsk, dst);
tcp_sync_mss(newsk, dst_mtu(dst));
- newtp->advmss = dst_metric_advmss(dst);
- if (tcp_sk(sk)->rx_opt.user_mss &&
- tcp_sk(sk)->rx_opt.user_mss < newtp->advmss)
- newtp->advmss = tcp_sk(sk)->rx_opt.user_mss;
+ newtp->advmss = tcp_mss_clamp(tcp_sk(sk), dst_metric_advmss(dst));
tcp_initialize_rcv_mss(newsk);