Skip to contentSkip to conversation

options: copy entire extension area to option struct

PATCH In review Florian Westphal 3 participants 3 messages Oct 4, 2019 – Oct 5, 2019

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author
#0 lore raw

PATCH 1/1 options: copy entire extension area to option struct

No reason to copy each member individually, just copy everything. This means we will also copy ext->data_fin which was not done before.

squashto: "mptcp: Write MPTCP DSS headers to outgoing data packets"

Signed-off-by Florian Westphal <fw(a)strlen.de>
---
 net/mptcp/options.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
net/mptcp/options.c +2 -7
index a33c202db009..d00e86550d8b 100644
@@ -402,13 +402,8 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
 		if (map_size <= remaining) {
 			remaining -= map_size;
 			dss_size = map_size;
-			if (mpext) {
-				opts->ext_copy.data_seq = mpext->data_seq;
-				opts->ext_copy.subflow_seq = mpext->subflow_seq;
-				opts->ext_copy.data_len = mpext->data_len;
-				opts->ext_copy.use_map = 1;
-				opts->ext_copy.dsn64 = mpext->dsn64;
-			}
+			if (mpext)
+				opts->ext_copy = *mpext;
 		} else {
 			opts->ext_copy.use_map = 0;
 			WARN_ONCE(1, "MPTCP: Map dropped");
Signature · 1 line
2.21.0
#1 lore raw
Quoted 2 lines · Florian Westphal

No reason to copy each member individually, just copy everything. This means we will also copy ext->data_fin which was not done before.

Looks good to me. I think the missing data_fin copy was a bug.

Mat

Quoted 34 lines

squashto: "mptcp: Write MPTCP DSS headers to outgoing data packets"

Signed-off-by Florian Westphal <fw(a)strlen.de>

---
net/mptcp/options.c | 9 ++-------

1 file changed, 2 insertions(+), 7 deletions(-)
net/mptcp/options.c +2 -7
index a33c202db009..d00e86550d8b 100644
@@ -402,13 +402,8 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
 		if (map_size <= remaining) {
 			remaining -= map_size;
 			dss_size = map_size;
-			if (mpext) {
-				opts->ext_copy.data_seq = mpext->data_seq;
-				opts->ext_copy.subflow_seq = mpext->subflow_seq;
-				opts->ext_copy.data_len = mpext->data_len;
-				opts->ext_copy.use_map = 1;
-				opts->ext_copy.dsn64 = mpext->dsn64;
-			}
+			if (mpext)
+				opts->ext_copy = *mpext;
 		} else {
 			opts->ext_copy.use_map = 0;
 			WARN_ONCE(1, "MPTCP: Map dropped");
Signature · 4 lines
2.21.0
_______________________________________________
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 Florian, Mat,

Quoted 7 lines · Mat Martineau
Quoted 2 lines · Florian Westphal

No reason to copy each member individually, just copy everything. This means we will also copy ext->data_fin which was not done before.

Looks good to me. I think the missing data_fin copy was a bug.

Thank you for the patch -- good catch -- and the review!

- e00602aa68b2: "squashed" in "mptcp: Write MPTCP DSS headers to outgoing data packets"
- already has signed-off
- 2f9e62154e58..94fbc140ae04: result

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