Files
linuxkit/kernel/patches-4.13.x/0014-hv-sock-avoid-double-FINs-if-shutdown-is-called.patch
Rolf Neugebauer d0e55af229 kernel: Add support for 4.13 kernels
The patches from 4.12 applied cleanly, except for 81304747d9
("Drivers: hv: vmbus: Fix rescind handling"), which was already
in upstream so has been dropped from the patch series.

The kernel config is from 4.12 run through defconfig/oldconfig to
pick up any new defaults.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-10-02 16:20:02 +01:00

42 lines
1.2 KiB
Diff

From 5e7aa7b6c216517d56f5633023044c4a59f9eb23 Mon Sep 17 00:00:00 2001
From: Dexuan Cui <decui@microsoft.com>
Date: Fri, 7 Jul 2017 09:15:29 +0800
Subject: [PATCH 14/17] hv-sock: avoid double FINs if shutdown() is called
The host expects a single FIN.
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Origin: git@github.com:dcui/linux.git
(cherry picked from commit f315dfcf9c3b4b32f43a21664762cbacd8f05d6a)
---
net/vmw_vsock/hyperv_transport.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
index b8bf1446ae13..50e4bc822c69 100644
--- a/net/vmw_vsock/hyperv_transport.c
+++ b/net/vmw_vsock/hyperv_transport.c
@@ -95,6 +95,9 @@ struct hvsock {
u32 recv_data_len;
/* The offset of the payload */
u32 recv_data_off;
+
+ /* Have we sent the zero-length packet (FIN)? */
+ unsigned long fin_sent;
};
/* In the VM, we support Hyper-V Sockets with AF_VSOCK, and the endpoint is
@@ -425,6 +428,9 @@ static int hvs_shutdown(struct vsock_sock *vsk, int mode)
hvs = vsk->trans;
+ if (test_and_set_bit(0, &hvs->fin_sent))
+ return 0;
+
send_buf = (struct hvs_send_buf *)&hdr;
/* It can't fail: see hvs_channel_writable_bytes(). */
--
2.14.1