Thread (13 messages) flat view 13 messages, 4 authors, 2016-07-18

Re: [CRIU] TCP_REPAIR MSS issue

From: Andrey Vagin <hidden>
Date: 2016-06-14 17:30:53

Hi,

Recently we found that we have to restore more parameters for tcp
sockets.
https://patchwork.kernel.org/patch/9144995/

As for your problem, criu saves and restores mss_clamp. Could you check
that it works for your case?

on dump:
	static int tcp_stream_get_options(int sk, struct tcp_info *ti,
	TcpStreamEntry *tse)
	{
		int ret;
		socklen_t auxl;
		int val;

		auxl = sizeof(tse->mss_clamp);
		ret = getsockopt(sk, SOL_TCP, TCP_MAXSEG, &tse->mss_clamp, &auxl);
		if (ret < 0)
			goto err_sopt;

on restore:
        pr_debug("Will set mss clamp to %u\n", tse->mss_clamp);
        opts[onr].opt_code = TCPOPT_MAXSEG;
        opts[onr].opt_val = tse->mss_clamp;
        onr++;

        if (setsockopt(sk, SOL_TCP, TCP_REPAIR_OPTIONS,
                                opts, onr * sizeof(struct tcp_repair_opt)) < 0) {
                pr_perror("Can't repair options");
                return -1;
        }

Thanks,
Andrew

On Tue, Jun 14, 2016 at 11:40:01AM +0000, Eggert, Lars wrote:
On 2016-06-14, at 13:28, Pavel Emelyanov [off-list ref] wrote:
quoted
Andrey (in Cc) has played with TCP_REPAIR recently, I guess he can know something.
Thanks for CC'ing him. We looked a little bit more into this:

When TCP_REPAIR is on, tcp_connect() directly calls tcp_finish_connect() before returning, passing NULL for skb, which causes sk_rx_dst_set() to be bypassed. Later, when TCP_REPAIR is being turned off, do_tcp_setsockopt() just does tcp_send_window_probe(), but apparently all the "dst" stuff is being bypassed then also, so the mss remains at TCP_MSS_DEFAULT.

Lars
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help