File tree Expand file tree Collapse file tree 2 files changed +21
-22
lines changed Expand file tree Collapse file tree 2 files changed +21
-22
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,6 @@ static void mptcp_parse_option(const struct sk_buff *skb,
108
108
mp_opt -> suboptions |= OPTION_MPTCP_DSS ;
109
109
mp_opt -> use_map = 1 ;
110
110
mp_opt -> mpc_map = 1 ;
111
- mp_opt -> use_ack = 0 ;
112
111
mp_opt -> data_len = get_unaligned_be16 (ptr );
113
112
ptr += 2 ;
114
113
}
@@ -157,11 +156,6 @@ static void mptcp_parse_option(const struct sk_buff *skb,
157
156
pr_debug ("DSS\n" );
158
157
ptr ++ ;
159
158
160
- /* we must clear 'mpc_map' be able to detect MP_CAPABLE
161
- * map vs DSS map in mptcp_incoming_options(), and reconstruct
162
- * map info accordingly
163
- */
164
- mp_opt -> mpc_map = 0 ;
165
159
flags = (* ptr ++ ) & MPTCP_DSS_FLAG_MASK ;
166
160
mp_opt -> data_fin = (flags & MPTCP_DSS_DATA_FIN ) != 0 ;
167
161
mp_opt -> dsn64 = (flags & MPTCP_DSS_DSN64 ) != 0 ;
@@ -369,8 +363,11 @@ void mptcp_get_options(const struct sk_buff *skb,
369
363
const unsigned char * ptr ;
370
364
int length ;
371
365
372
- /* initialize option status */
373
- mp_opt -> suboptions = 0 ;
366
+ /* Ensure that casting the whole status to u32 is efficient and safe */
367
+ BUILD_BUG_ON (sizeof_field (struct mptcp_options_received , status ) != sizeof (u32 ));
368
+ BUILD_BUG_ON (!IS_ALIGNED (offsetof(struct mptcp_options_received , status ),
369
+ sizeof (u32 )));
370
+ * (u32 * )& mp_opt -> status = 0 ;
374
371
375
372
length = (th -> doff * 4 ) - sizeof (struct tcphdr );
376
373
ptr = (const unsigned char * )(th + 1 );
Original file line number Diff line number Diff line change @@ -149,22 +149,24 @@ struct mptcp_options_received {
149
149
u32 subflow_seq ;
150
150
u16 data_len ;
151
151
__sum16 csum ;
152
- u16 suboptions ;
152
+ struct_group (status ,
153
+ u16 suboptions ;
154
+ u16 use_map :1 ,
155
+ dsn64 :1 ,
156
+ data_fin :1 ,
157
+ use_ack :1 ,
158
+ ack64 :1 ,
159
+ mpc_map :1 ,
160
+ reset_reason :4 ,
161
+ reset_transient :1 ,
162
+ echo :1 ,
163
+ backup :1 ,
164
+ deny_join_id0 :1 ,
165
+ __unused :2 ;
166
+ );
167
+ u8 join_id ;
153
168
u32 token ;
154
169
u32 nonce ;
155
- u16 use_map :1 ,
156
- dsn64 :1 ,
157
- data_fin :1 ,
158
- use_ack :1 ,
159
- ack64 :1 ,
160
- mpc_map :1 ,
161
- reset_reason :4 ,
162
- reset_transient :1 ,
163
- echo :1 ,
164
- backup :1 ,
165
- deny_join_id0 :1 ,
166
- __unused :2 ;
167
- u8 join_id ;
168
170
u64 thmac ;
169
171
u8 hmac [MPTCPOPT_HMAC_LEN ];
170
172
struct mptcp_addr_info addr ;
You can’t perform that action at this time.
0 commit comments