All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tcp: fix TCP_MAXSEG for established IPv6 passive sockets
@ 2012-04-22 19:45 Neal Cardwell
  2012-04-22 20:14 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Neal Cardwell @ 2012-04-22 19:45 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Eric Dumazet, Nandita Dukkipati, Yuchung Cheng,
	ilpo.jarvinen, maze, Tom Herbert, Neal Cardwell

Commit f5fff5d forgot to fix TCP_MAXSEG behavior IPv6 sockets, so IPv6
TCP server sockets that used TCP_MAXSEG would find that the advmss of
child sockets would be incorrect. This commit mirrors the advmss logic
from tcp_v4_syn_recv_sock in tcp_v6_syn_recv_sock. Eventually this
logic should probably be shared between IPv4 and IPv6, but this at
least fixes this issue.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
---
 net/ipv6/tcp_ipv6.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 86cfe60..98256cf 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1383,6 +1383,10 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
 	tcp_mtup_init(newsk);
 	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;
+
 	tcp_initialize_rcv_mss(newsk);
 	if (tcp_rsk(req)->snt_synack)
 		tcp_valid_rtt_meas(newsk,
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tcp: fix TCP_MAXSEG for established IPv6 passive sockets
  2012-04-22 19:45 [PATCH] tcp: fix TCP_MAXSEG for established IPv6 passive sockets Neal Cardwell
@ 2012-04-22 20:14 ` Eric Dumazet
  2012-04-22 21:10   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2012-04-22 20:14 UTC (permalink / raw)
  To: Neal Cardwell
  Cc: David Miller, netdev, Eric Dumazet, Nandita Dukkipati,
	Yuchung Cheng, ilpo.jarvinen, maze, Tom Herbert

On Sun, 2012-04-22 at 15:45 -0400, Neal Cardwell wrote:
> Commit f5fff5d forgot to fix TCP_MAXSEG behavior IPv6 sockets, so IPv6
> TCP server sockets that used TCP_MAXSEG would find that the advmss of
> child sockets would be incorrect. This commit mirrors the advmss logic
> from tcp_v4_syn_recv_sock in tcp_v6_syn_recv_sock. Eventually this
> logic should probably be shared between IPv4 and IPv6, but this at
> least fixes this issue.
> 
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
> ---
>  net/ipv6/tcp_ipv6.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
> index 86cfe60..98256cf 100644
> --- a/net/ipv6/tcp_ipv6.c
> +++ b/net/ipv6/tcp_ipv6.c
> @@ -1383,6 +1383,10 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
>  	tcp_mtup_init(newsk);
>  	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;
> +
>  	tcp_initialize_rcv_mss(newsk);
>  	if (tcp_rsk(req)->snt_synack)
>  		tcp_valid_rtt_meas(newsk,

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tcp: fix TCP_MAXSEG for established IPv6 passive sockets
  2012-04-22 20:14 ` Eric Dumazet
@ 2012-04-22 21:10   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2012-04-22 21:10 UTC (permalink / raw)
  To: eric.dumazet
  Cc: ncardwell, netdev, edumazet, nanditad, ycheng, ilpo.jarvinen,
	maze, therbert

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 22 Apr 2012 22:14:54 +0200

> On Sun, 2012-04-22 at 15:45 -0400, Neal Cardwell wrote:
>> Commit f5fff5d forgot to fix TCP_MAXSEG behavior IPv6 sockets, so IPv6
>> TCP server sockets that used TCP_MAXSEG would find that the advmss of
>> child sockets would be incorrect. This commit mirrors the advmss logic
>> from tcp_v4_syn_recv_sock in tcp_v6_syn_recv_sock. Eventually this
>> logic should probably be shared between IPv4 and IPv6, but this at
>> least fixes this issue.
>> 
>> Signed-off-by: Neal Cardwell <ncardwell@google.com>
 ...
> Acked-by: Eric Dumazet <edumazet@google.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-22 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-22 19:45 [PATCH] tcp: fix TCP_MAXSEG for established IPv6 passive sockets Neal Cardwell
2012-04-22 20:14 ` Eric Dumazet
2012-04-22 21:10   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.