From patchwork Fri Nov 29 12:54:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davide Caratti X-Patchwork-Id: 1202473 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.01.org (client-ip=198.145.21.10; helo=ml01.01.org; envelope-from=mptcp-bounces@lists.01.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="f+RZkTBH"; dkim-atps=neutral Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47PZFz4p8Tz9sPj for ; Fri, 29 Nov 2019 23:54:14 +1100 (AEDT) Received: from ml01.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 607CC1011350E; Fri, 29 Nov 2019 04:57:33 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=207.211.31.120; helo=us-smtp-1.mimecast.com; envelope-from=dcaratti@redhat.com; receiver= Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 23A531011350C for ; Fri, 29 Nov 2019 04:57:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575032046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZBXKzd5wHwaDpHcJhE9/lxs+5BsshnFTcuz5U6X/uBk=; b=f+RZkTBHLNZiv5J2JyHhxDRYcbFjGT32DiorN33AoOCGPxdxMu7KszIzB4A7DUxqLr+H6l dgHplLDzPiU0AeFdfGJaS33/TxBjxL3ZX5R+C7tpborbGPuXy/hg7MbG8FEofb54ys2cHG vOtYH7ujd29y2cwgJgomrKxiqaX2CaI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-337-B_L5a2L_PlmBQNuuUyy9KA-1; Fri, 29 Nov 2019 07:54:05 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 179AF800C7D; Fri, 29 Nov 2019 12:54:04 +0000 (UTC) Received: from ovpn-204-242.brq.redhat.com (ovpn-204-242.brq.redhat.com [10.40.204.242]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B8D25C1BB; Fri, 29 Nov 2019 12:54:02 +0000 (UTC) Message-ID: <965954023c7a67bfd8e7f42bba7c19b512b8241c.camel@redhat.com> From: Davide Caratti To: Christoph Paasch , mptcp@lists.01.org In-Reply-To: <20191107152827.54549-2-cpaasch@apple.com> References: <20191107152827.54549-1-cpaasch@apple.com> <20191107152827.54549-2-cpaasch@apple.com> Organization: red hat Date: Fri, 29 Nov 2019 13:54:02 +0100 MIME-Version: 1.0 User-Agent: Evolution 3.34.1 (3.34.1-1.fc31) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: B_L5a2L_PlmBQNuuUyy9KA-1 X-Mimecast-Spam-Score: 0 Message-ID-Hash: YGQ6YZXWZ27ROZB43WASY2YN4I3TCRMA X-Message-ID-Hash: YGQ6YZXWZ27ROZB43WASY2YN4I3TCRMA X-MailFrom: dcaratti@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list Subject: [MPTCP] Re: [PATCH 1/2] mptcp: parse and emit MP_CAPABLE option according to v1 spec. List-Id: Discussions regarding MPTCP upstreaming Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: On Thu, 2019-11-07 at 07:28 -0800, Christoph Paasch wrote: > -#define TCPOLEN_MPTCP_MPC_SYNACK 20 > +#define TCPOLEN_MPTCP_MPC_SYN 4 > +#define TCPOLEN_MPTCP_MPC_SYNACK 12 > #define TCPOLEN_MPTCP_MPC_ACK 20 hello Christoph and Paolo, the length of the 'mp_capable' option in the SYN/ACK doesn't really change when moving from v0 to v1 version of the MPTCP protocol. Current mptcp net-next echoes the client's key in the SYN/ACK but I think this is not intentional (at least, it does not seem to adhere to section 3.1 of RFC https://tools.ietf.org/html/rfc6824). For the record, this is why tcpdump refuses to dissect captures of selftests: # ./mptcp_connect.sh -4 -c -e IP 10.0.1.1.49752 > 10.0.1.1.10000: Flags [S], seq 2594718977, win 65535, options [mss 65495,sackOK,TS val 3944347269 ecr 0,nop,wscale 8,mptcp capable {0xf931b304deb39a42}], length 0 IP 10.0.1.1.10000 > 10.0.1.1.49752: Flags [S.], seq 3996234497, ack 2594718978, win 65535, options [mss 65495,sackOK,TS val 3944347270 ecr 3944347269,nop,wscale 8,mptcp capable[bad opt]> ^^^ bad option IP 10.0.1.1.49752 > 10.0.1.1.10000: Flags [.], ack 1, win 256, options [nop,nop,TS val 3944347270 ecr 3944347270,mptcp capable {0xf931b304deb39a42,0x96614f185e633ce}], length 0 and also, it's the reason why packetdrill never stores the server key in its variables, see: https://github.com/dcaratti/packetdrill/issues/1#issuecomment-559569544 is it possible to fix size of the syn/ack generated by v0 version of the protocol as a separate patch? Otherwise I will need to add a special handling for SYN/ACK packets generated by v0 net-next kernels packets. (the code I tried is quite trivial, and it passes the smoke-test in tools/testing/selftests) --- >8 --- --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -57,16 +57,8 @@ void mptcp_parse_option(const unsigned char *ptr, int opsize, mp_opt->sndr_key = get_unaligned_be64(ptr); ptr += 8; - if (opsize == TCPOLEN_MPTCP_MPC_SYNACK) { - mp_opt->rcvr_key = get_unaligned_be64(ptr); - ptr += 8; - pr_debug("MP_CAPABLE flags=%x, sndr=%llu, rcvr=%llu", - mp_opt->flags, mp_opt->sndr_key, - mp_opt->rcvr_key); - } else { - pr_debug("MP_CAPABLE flags=%x, sndr=%llu", - mp_opt->flags, mp_opt->sndr_key); - } + pr_debug("MP_CAPABLE flags=%x, sndr=%llu", + mp_opt->flags, mp_opt->sndr_key); break; /* MPTCPOPT_MP_JOIN @@ -650,8 +642,7 @@ void mptcp_write_options(__be32 *ptr, struct mptcp_out_options *opts) MPTCP_CAP_HMAC_SHA1); put_unaligned_be64(opts->sndr_key, ptr); ptr += 2; - if ((OPTION_MPTCP_MPC_SYNACK | - OPTION_MPTCP_MPC_ACK) & opts->suboptions) { + if (OPTION_MPTCP_MPC_ACK & opts->suboptions) { put_unaligned_be64(opts->rcvr_key, ptr); ptr += 2; } any feedback appreciated, thank you in advance! diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index acad61c70de9..10347c9b4dff 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -34,7 +34,7 @@ /* MPTCP suboption lengths */ #define TCPOLEN_MPTCP_MPC_SYN 12 -#define TCPOLEN_MPTCP_MPC_SYNACK 20 +#define TCPOLEN_MPTCP_MPC_SYNACK 12 #define TCPOLEN_MPTCP_MPC_ACK 20 #define TCPOLEN_MPTCP_MPJ_SYN 12 #define TCPOLEN_MPTCP_MPJ_SYNACK 16 --- >8 ---