Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8a6e65f authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

tcp: inherit listener congestion control for passive cnx



Rick Jones reported that TCP_CONGESTION sockopt performed on a listener
was ignored for its children sockets : right after accept() the
congestion control for new socket is the system default one.

This seems an oversight of the initial design (quoted from Stephen)

Based on prior investigation and patch from Rick.

Reported-by: default avatarRick Jones <rick.jones2@hp.com>
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
CC: Stephen Hemminger <shemminger@vyatta.com>
CC: Yuchung Cheng <ycheng@google.com>
Tested-by: default avatarRick Jones <rick.jones2@hp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent de565664
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -175,6 +175,9 @@ tcp_congestion_control - STRING
	connections. The algorithm "reno" is always available, but
	additional choices may be available based on kernel configuration.
	Default is set as part of kernel configuration.
	For passive connections, the listener congestion control choice
	is inherited.
	[see setsockopt(listenfd, SOL_TCP, TCP_CONGESTION, "name" ...) ]

tcp_cookie_size - INTEGER
	Default size of TCP Cookie Transactions (TCPCT) option, that may be
+1 −0
Original line number Diff line number Diff line
@@ -1511,6 +1511,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
	return NULL;
put_and_exit:
	tcp_clear_xmit_timers(newsk);
	tcp_cleanup_congestion_control(newsk);
	bh_unlock_sock(newsk);
	sock_put(newsk);
	goto exit;
+3 −1
Original line number Diff line number Diff line
@@ -495,6 +495,8 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
		newtp->frto_counter = 0;
		newtp->frto_highmark = 0;

		if (newicsk->icsk_ca_ops != &tcp_init_congestion_ops &&
		    !try_module_get(newicsk->icsk_ca_ops->owner))
			newicsk->icsk_ca_ops = &tcp_init_congestion_ops;

		tcp_set_ca_state(newsk, TCP_CA_Open);