All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH 6/7] mptcp: Check flags in MP_CAPABLE option
@ 2019-06-06  0:36 Peter Krystad
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Krystad @ 2019-06-06  0:36 UTC (permalink / raw)
  To: mptcp 

[-- Attachment #1: Type: text/plain, Size: 1401 bytes --]

squashto: Handle MPTCP TCP options

Signed-off-by: Peter Krystad <peter.krystad(a)linux.intel.com>
---
 net/mptcp/options.c  | 6 +++++-
 net/mptcp/protocol.h | 7 ++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index df4405d268f0..98d582207cb0 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -29,8 +29,12 @@ void mptcp_parse_option(const unsigned char *ptr, int opsize,
 		if (mp_opt->version != 0)
 			break;
 
-		mp_opt->mp_capable = 1;
 		mp_opt->flags = *ptr++;
+		if (!((mp_opt->flags & MPTCP_CAP_FLAG_MASK) == MPTCP_CAP_HMAC_SHA1) ||
+		    (mp_opt->flags & MPTCP_CAP_EXTENSIBILITY))
+			break;
+
+		mp_opt->mp_capable = 1;
 		mp_opt->sndr_key = get_unaligned_be64(ptr);
 		ptr += 8;
 
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 6498e68e1030..2c2f2ca4312b 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -23,9 +23,10 @@
 #define MPTCPOPT_VERSION_MASK	0x0F
 
 /* MPTCP handshake flags */
-#define MPTCP_CAP_CHECKSUM_REQD	(1 << 7)
-#define MPTCP_CAP_EXTENSIBILITY	(1 << 6)
-#define MPTCP_CAP_HMAC_SHA1	(1 << 0)
+#define MPTCP_CAP_CHECKSUM_REQD	BIT(7)
+#define MPTCP_CAP_EXTENSIBILITY	BIT(6)
+#define MPTCP_CAP_HMAC_SHA1	BIT(0)
+#define MPTCP_CAP_FLAG_MASK	(0x3F)
 
 /* MPTCP DSS flags */
 #define MPTCP_DSS_DATA_FIN	BIT(4)
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [MPTCP] [PATCH 6/7] mptcp: Check flags in MP_CAPABLE option
@ 2019-06-07 11:24 Matthieu Baerts
  0 siblings, 0 replies; 2+ messages in thread
From: Matthieu Baerts @ 2019-06-07 11:24 UTC (permalink / raw)
  To: mptcp 

[-- Attachment #1: Type: text/plain, Size: 1542 bytes --]

Hi Peter, Paolo,

On 06/06/2019 02:36, Peter Krystad wrote:
> squashto: Handle MPTCP TCP options

Thank you for the patch and the review!

- 5f1e8d8943f5: "squash" in "mptcp: Handle MPTCP TCP options". Note that
I had to modify the variables, please see below
- signed-off was already there
- 062cef9d7641: conflict
- 666387ce8fc1..2d097652ba6c: result


> Signed-off-by: Peter Krystad <peter.krystad(a)linux.intel.com>
> ---
>  net/mptcp/options.c  | 6 +++++-
>  net/mptcp/protocol.h | 7 ++++---
>  2 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index df4405d268f0..98d582207cb0 100644
> --- a/net/mptcp/options.c
> +++ b/net/mptcp/options.c
> @@ -29,8 +29,12 @@ void mptcp_parse_option(const unsigned char *ptr, int opsize,
>  		if (mp_opt->version != 0)
>  			break;
>  
> -		mp_opt->mp_capable = 1;
>  		mp_opt->flags = *ptr++;
> +		if (!((mp_opt->flags & MPTCP_CAP_FLAG_MASK) == MPTCP_CAP_HMAC_SHA1) ||
> +		    (mp_opt->flags & MPTCP_CAP_EXTENSIBILITY))
> +			break;
> +
> +		mp_opt->mp_capable = 1;

I had to switch back to "opt_rx->mptcp" instead of "mp_opt" as I didn't
take your first patch of this series. When you will provide a v2 for
this patch 1/7, can you do a rebase first and do the opposite change to
use "mp_opt" please?

Cheers,
Matt
-- 
Matthieu Baerts | R&D Engineer
matthieu.baerts(a)tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-07 11:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-06  0:36 [MPTCP] [PATCH 6/7] mptcp: Check flags in MP_CAPABLE option Peter Krystad
  -- strict thread matches above, loose matches on Subject: below --
2019-06-07 11:24 Matthieu Baerts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.