diff mbox series

[RESEND,mptcp-next,3/3] mptcp: send out MP_FAIL when data checksum fail

Message ID f46dabaf1055b87b5613b126372d9e506c178264.1620282930.git.geliangtang@gmail.com (mailing list archive)
State Superseded, archived
Delegated to: Mat Martineau
Headers show
Series Please ignore: resending some patches for patchwork.kernel.org | expand

Commit Message

Matthieu Baerts May 26, 2021, 4:08 p.m. UTC
From: Geliang Tang <geliangtang@gmail.com>

When a bad checksum is detected, send out the MP_FAIL suboption.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 net/mptcp/subflow.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 659b8842ae3b..efd84ff61015 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -906,6 +906,8 @@  static enum mapping_status validate_data_csum(struct sock *ssk, struct sk_buff *
 	csum = csum_partial(&header, sizeof(header), subflow->map_data_csum);
 	if (unlikely(csum_fold(csum))) {
 		MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DSSCSUMERR);
+		subflow->send_mp_fail = 1;
+		subflow->fail_seq = subflow->map_seq;
 		return subflow->mp_join ? MAPPING_INVALID : MAPPING_DUMMY;
 	}