Skip to contentSkip to conversation

mptcp: Remove protocol spec comments from mptcp_parse_option

PATCH In review Peter Krystad 3 participants 4 messages Jan 18, 2020 – Jan 20, 2020

Subsystems (2)
lore
Share & tools
lore

Peter Krystad

author
#0 lore raw

PATCH 1/1 mptcp: Remove protocol spec comments from mptcp_parse_option

They are already out-of-date. Let them read the spec, or least look at the pictures!

squashto: Handle MPTCP TCP options

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>
---
 net/mptcp/options.c | 60 ---------------------------------------------
 1 file changed, 60 deletions(-)
net/mptcp/options.c +0 -60
index 81d8704cbd3f..51290ec970bd 100644
@@ -24,12 +24,6 @@ void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr,
 	u8 flags;
 
 	switch (subtype) {
-	/* MPTCPOPT_MP_CAPABLE
-	 * 0: 4MSB=subtype, 4LSB=version
-	 * 1: Handshake flags
-	 * 2-9: Sender key
-	 * 10-17: Receiver key (optional)
-	 */
 	case MPTCPOPT_MP_CAPABLE:
 		/* strict size checking */
 		if (!(TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN)) {
@@ -102,22 +96,6 @@ void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr,
 			 mp_opt->rcvr_key, mp_opt->data_len);
 		break;
 
-	/* MPTCPOPT_MP_JOIN
-	 * Initial SYN
-	 * 0: 4MSB=subtype, 000, 1LSB=Backup
-	 * 1: Address ID
-	 * 2-5: Receiver token
-	 * 6-9: Sender random number
-	 * SYN/ACK response
-	 * 0: 4MSB=subtype, 000, 1LSB=Backup
-	 * 1: Address ID
-	 * 2-9: Sender truncated HMAC
-	 * 10-13: Sender random number
-	 * Third ACK
-	 * 0: 4MSB=subtype, 0000
-	 * 1: 0 (Reserved)
-	 * 2-21: Sender HMAC
-	 */
 	case MPTCPOPT_MP_JOIN:
 		mp_opt->mp_join = 1;
 		if (opsize == TCPOLEN_MPTCP_MPJ_SYN) {
@@ -150,17 +128,6 @@ void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr,
 		}
 		break;
 
-
-	/* MPTCPOPT_DSS
-	 * 0: 4MSB=subtype, 0000
-	 * 1: 3MSB=0, F=Data FIN, m=DSN length, M=has DSN/SSN/DLL/checksum,
-	 *    a=DACK length, A=has DACK
-	 * 0, 4, or 8 bytes of DACK (depending on A/a)
-	 * 0, 4, or 8 bytes of DSN (depending on M/m)
-	 * 0 or 4 bytes of SSN (depending on M)
-	 * 0 or 2 bytes of DLL (depending on M)
-	 * 0 or 2 bytes of checksum (depending on M)
-	 */
 	case MPTCPOPT_DSS:
 		pr_debug("DSS");
 		ptr++;
@@ -243,12 +210,6 @@ void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr,
 
 		break;
 
-	/* MPTCPOPT_ADD_ADDR
-	 * 0: 4MSB=subtype, 4LSB=IP version (4 or 6)
-	 * 1: Address ID
-	 * 4 or 16 bytes of address (depending on ip version)
-	 * 0 or 2 bytes of port (depending on length)
-	 */
 	case MPTCPOPT_ADD_ADDR:
 		if (opsize != TCPOLEN_MPTCP_ADD_ADDR &&
 		    opsize != TCPOLEN_MPTCP_ADD_ADDR6)
@@ -282,11 +243,6 @@ void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr,
 #endif
 		break;
 
-	/* MPTCPOPT_RM_ADDR
-	 * 0: 4MSB=subtype, 0000
-	 * 1: Address ID
-	 * Additional bytes: More address IDs (depending on length)
-	 */
 	case MPTCPOPT_RM_ADDR:
 		if (opsize != TCPOLEN_MPTCP_RM_ADDR)
 			break;
@@ -296,22 +252,6 @@ void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr,
 		pr_debug("RM_ADDR: id=%d", mp_opt->addr_id);
 		break;
 
-	/* MPTCPOPT_MP_PRIO
-	 * 0: 4MSB=subtype, 000, 1LSB=Backup
-	 * 1: Address ID (optional, current addr implied if not present)
-	 */
-
-	/* MPTCPOPT_MP_FAIL
-	 * 0: 4MSB=subtype, 0000
-	 * 1: 0 (Reserved)
-	 * 2-9: DSN
-	 */
-
-	/* MPTCPOPT_MP_FASTCLOSE
-	 * 0: 4MSB=subtype, 0000
-	 * 1: 0 (Reserved)
-	 * 2-9: Receiver key
-	 */
 	default:
 		break;
 	}
Signature · 1 line
2.17.2
#1 lore raw
Quoted 2 lines · Peter Krystad

They are already out-of-date. Let them read the spec, or least look at the pictures!

I agree, it's good to remove these.

Thanks,
Mat

Quoted 120 lines

squashto: Handle MPTCP TCP options

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>

---
net/mptcp/options.c | 60 ---------------------------------------------

1 file changed, 60 deletions(-)
net/mptcp/options.c +0 -60
index 81d8704cbd3f..51290ec970bd 100644
@@ -24,12 +24,6 @@ void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr,
 	u8 flags;
 
 	switch (subtype) {
-	/* MPTCPOPT_MP_CAPABLE
-	 * 0: 4MSB=subtype, 4LSB=version
-	 * 1: Handshake flags
-	 * 2-9: Sender key
-	 * 10-17: Receiver key (optional)
-	 */
 	case MPTCPOPT_MP_CAPABLE:
 		/* strict size checking */
 		if (!(TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN)) {
@@ -102,22 +96,6 @@ void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr,
 			 mp_opt->rcvr_key, mp_opt->data_len);
 		break;
 
-	/* MPTCPOPT_MP_JOIN
-	 * Initial SYN
-	 * 0: 4MSB=subtype, 000, 1LSB=Backup
-	 * 1: Address ID
-	 * 2-5: Receiver token
-	 * 6-9: Sender random number
-	 * SYN/ACK response
-	 * 0: 4MSB=subtype, 000, 1LSB=Backup
-	 * 1: Address ID
-	 * 2-9: Sender truncated HMAC
-	 * 10-13: Sender random number
-	 * Third ACK
-	 * 0: 4MSB=subtype, 0000
-	 * 1: 0 (Reserved)
-	 * 2-21: Sender HMAC
-	 */
 	case MPTCPOPT_MP_JOIN:
 		mp_opt->mp_join = 1;
 		if (opsize == TCPOLEN_MPTCP_MPJ_SYN) {
@@ -150,17 +128,6 @@ void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr,
 		}
 		break;
 
-
-	/* MPTCPOPT_DSS
-	 * 0: 4MSB=subtype, 0000
-	 * 1: 3MSB=0, F=Data FIN, m=DSN length, M=has DSN/SSN/DLL/checksum,
-	 *    a=DACK length, A=has DACK
-	 * 0, 4, or 8 bytes of DACK (depending on A/a)
-	 * 0, 4, or 8 bytes of DSN (depending on M/m)
-	 * 0 or 4 bytes of SSN (depending on M)
-	 * 0 or 2 bytes of DLL (depending on M)
-	 * 0 or 2 bytes of checksum (depending on M)
-	 */
 	case MPTCPOPT_DSS:
 		pr_debug("DSS");
 		ptr++;
@@ -243,12 +210,6 @@ void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr,
 
 		break;
 
-	/* MPTCPOPT_ADD_ADDR
-	 * 0: 4MSB=subtype, 4LSB=IP version (4 or 6)
-	 * 1: Address ID
-	 * 4 or 16 bytes of address (depending on ip version)
-	 * 0 or 2 bytes of port (depending on length)
-	 */
 	case MPTCPOPT_ADD_ADDR:
 		if (opsize != TCPOLEN_MPTCP_ADD_ADDR &&
 		    opsize != TCPOLEN_MPTCP_ADD_ADDR6)
@@ -282,11 +243,6 @@ void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr,
 #endif
 		break;
 
-	/* MPTCPOPT_RM_ADDR
-	 * 0: 4MSB=subtype, 0000
-	 * 1: Address ID
-	 * Additional bytes: More address IDs (depending on length)
-	 */
 	case MPTCPOPT_RM_ADDR:
 		if (opsize != TCPOLEN_MPTCP_RM_ADDR)
 			break;
@@ -296,22 +252,6 @@ void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr,
 		pr_debug("RM_ADDR: id=%d", mp_opt->addr_id);
 		break;
 
-	/* MPTCPOPT_MP_PRIO
-	 * 0: 4MSB=subtype, 000, 1LSB=Backup
-	 * 1: Address ID (optional, current addr implied if not present)
-	 */
-
-	/* MPTCPOPT_MP_FAIL
-	 * 0: 4MSB=subtype, 0000
-	 * 1: 0 (Reserved)
-	 * 2-9: DSN
-	 */
-
-	/* MPTCPOPT_MP_FASTCLOSE
-	 * 0: 4MSB=subtype, 0000
-	 * 1: 0 (Reserved)
-	 * 2-9: Receiver key
-	 */
 	default:
 		break;
 	}
Signature · 4 lines
2.17.2
_______________________________________________
mptcp mailing list -- mptcp(a)lists.01.org
To unsubscribe send an email to mptcp-leave(a)lists.01.org

--
Mat Martineau
Intel

#2 lore raw

Hi Mat, Peter,

Quoted 7 lines · Mat Martineau
Quoted 2 lines · Peter Krystad

They are already out-of-date. Let them read the spec, or least look at the pictures!

I agree, it's good to remove these.

Thank you for the patch and the review:

- 0d6a8d414b1d: "squashed" with conflicts in "mptcp: Handle MPTCP TCP options"
- e435077830e6: conflict in t/mptcp-Add-ADD_ADDR-handling
- 0afe0b6491a2: conflict in t/mptcp-Add-handling-of-incoming-MP_JOIN-requests
- 639d43b44b61..d23bb6b15878: result

Tests + export will be launched soon

Cheers,
Matt

Signature · 5 lines
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
#3 lore raw
In reply to Mat Martineau

Hi Peter, Mat,

Quoted 7 lines · Mat Martineau
Quoted 2 lines · Peter Krystad

They are already out-of-date. Let them read the spec, or least look at the pictures!

I agree, it's good to remove these.

Thank you for the patch and the review:

- 0d6a8d414b1d: "squashed" with conflicts in "mptcp: Handle MPTCP TCP options"
- e435077830e6: conflict in t/mptcp-Add-ADD_ADDR-handling
- 0afe0b6491a2: conflict in t/mptcp-Add-handling-of-incoming-MP_JOIN-requests
- 639d43b44b61..d23bb6b15878: result

Tests + export will be launched soon

Cheers,
Matt

Signature · 5 lines
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