Lines Matching refs:mp_opt

25 			       struct mptcp_options_received *mp_opt)  in mptcp_parse_option()  argument
89 mp_opt->suboptions |= OPTION_MPTCP_CSUMREQD; in mptcp_parse_option()
91 mp_opt->deny_join_id0 = !!(flags & MPTCP_CAP_DENY_JOIN_ID0); in mptcp_parse_option()
93 mp_opt->suboptions |= subopt; in mptcp_parse_option()
95 mp_opt->sndr_key = get_unaligned_be64(ptr); in mptcp_parse_option()
99 mp_opt->rcvr_key = get_unaligned_be64(ptr); in mptcp_parse_option()
108 mp_opt->suboptions |= OPTION_MPTCP_DSS; in mptcp_parse_option()
109 mp_opt->use_map = 1; in mptcp_parse_option()
110 mp_opt->mpc_map = 1; in mptcp_parse_option()
111 mp_opt->data_len = get_unaligned_be16(ptr); in mptcp_parse_option()
115 mp_opt->csum = get_unaligned((__force __sum16 *)ptr); in mptcp_parse_option()
116 mp_opt->suboptions |= OPTION_MPTCP_CSUMREQD; in mptcp_parse_option()
120 version, flags, opsize, mp_opt->sndr_key, in mptcp_parse_option()
121 mp_opt->rcvr_key, mp_opt->data_len, mp_opt->csum); in mptcp_parse_option()
125 mp_opt->suboptions |= OPTIONS_MPTCP_MPJ; in mptcp_parse_option()
127 mp_opt->backup = *ptr++ & MPTCPOPT_BACKUP; in mptcp_parse_option()
128 mp_opt->join_id = *ptr++; in mptcp_parse_option()
129 mp_opt->token = get_unaligned_be32(ptr); in mptcp_parse_option()
131 mp_opt->nonce = get_unaligned_be32(ptr); in mptcp_parse_option()
134 mp_opt->backup, mp_opt->join_id, in mptcp_parse_option()
135 mp_opt->token, mp_opt->nonce); in mptcp_parse_option()
137 mp_opt->backup = *ptr++ & MPTCPOPT_BACKUP; in mptcp_parse_option()
138 mp_opt->join_id = *ptr++; in mptcp_parse_option()
139 mp_opt->thmac = get_unaligned_be64(ptr); in mptcp_parse_option()
141 mp_opt->nonce = get_unaligned_be32(ptr); in mptcp_parse_option()
144 mp_opt->backup, mp_opt->join_id, in mptcp_parse_option()
145 mp_opt->thmac, mp_opt->nonce); in mptcp_parse_option()
148 memcpy(mp_opt->hmac, ptr, MPTCPOPT_HMAC_LEN); in mptcp_parse_option()
151 mp_opt->suboptions &= ~OPTIONS_MPTCP_MPJ; in mptcp_parse_option()
163 mp_opt->mpc_map = 0; in mptcp_parse_option()
165 mp_opt->data_fin = (flags & MPTCP_DSS_DATA_FIN) != 0; in mptcp_parse_option()
166 mp_opt->dsn64 = (flags & MPTCP_DSS_DSN64) != 0; in mptcp_parse_option()
167 mp_opt->use_map = (flags & MPTCP_DSS_HAS_MAP) != 0; in mptcp_parse_option()
168 mp_opt->ack64 = (flags & MPTCP_DSS_ACK64) != 0; in mptcp_parse_option()
169 mp_opt->use_ack = (flags & MPTCP_DSS_HAS_ACK); in mptcp_parse_option()
172 mp_opt->data_fin, mp_opt->dsn64, in mptcp_parse_option()
173 mp_opt->use_map, mp_opt->ack64, in mptcp_parse_option()
174 mp_opt->use_ack); in mptcp_parse_option()
178 if (mp_opt->use_ack) { in mptcp_parse_option()
179 if (mp_opt->ack64) in mptcp_parse_option()
185 if (mp_opt->use_map) { in mptcp_parse_option()
186 if (mp_opt->dsn64) in mptcp_parse_option()
199 mp_opt->suboptions |= OPTION_MPTCP_DSS; in mptcp_parse_option()
200 if (mp_opt->use_ack) { in mptcp_parse_option()
201 if (mp_opt->ack64) { in mptcp_parse_option()
202 mp_opt->data_ack = get_unaligned_be64(ptr); in mptcp_parse_option()
205 mp_opt->data_ack = get_unaligned_be32(ptr); in mptcp_parse_option()
209 pr_debug("data_ack=%llu", mp_opt->data_ack); in mptcp_parse_option()
212 if (mp_opt->use_map) { in mptcp_parse_option()
213 if (mp_opt->dsn64) { in mptcp_parse_option()
214 mp_opt->data_seq = get_unaligned_be64(ptr); in mptcp_parse_option()
217 mp_opt->data_seq = get_unaligned_be32(ptr); in mptcp_parse_option()
221 mp_opt->subflow_seq = get_unaligned_be32(ptr); in mptcp_parse_option()
224 mp_opt->data_len = get_unaligned_be16(ptr); in mptcp_parse_option()
228 mp_opt->suboptions |= OPTION_MPTCP_CSUMREQD; in mptcp_parse_option()
229 mp_opt->csum = get_unaligned((__force __sum16 *)ptr); in mptcp_parse_option()
234 mp_opt->data_seq, mp_opt->subflow_seq, in mptcp_parse_option()
235 mp_opt->data_len, !!(mp_opt->suboptions & OPTION_MPTCP_CSUMREQD), in mptcp_parse_option()
236 mp_opt->csum); in mptcp_parse_option()
242 mp_opt->echo = (*ptr++) & MPTCP_ADDR_ECHO; in mptcp_parse_option()
243 if (!mp_opt->echo) { in mptcp_parse_option()
246 mp_opt->addr.family = AF_INET; in mptcp_parse_option()
250 mp_opt->addr.family = AF_INET6; in mptcp_parse_option()
257 mp_opt->addr.family = AF_INET; in mptcp_parse_option()
261 mp_opt->addr.family = AF_INET6; in mptcp_parse_option()
267 mp_opt->suboptions |= OPTION_MPTCP_ADD_ADDR; in mptcp_parse_option()
268 mp_opt->addr.id = *ptr++; in mptcp_parse_option()
269 mp_opt->addr.port = 0; in mptcp_parse_option()
270 mp_opt->ahmac = 0; in mptcp_parse_option()
271 if (mp_opt->addr.family == AF_INET) { in mptcp_parse_option()
272 memcpy((u8 *)&mp_opt->addr.addr.s_addr, (u8 *)ptr, 4); in mptcp_parse_option()
276 mp_opt->addr.port = htons(get_unaligned_be16(ptr)); in mptcp_parse_option()
282 memcpy(mp_opt->addr.addr6.s6_addr, (u8 *)ptr, 16); in mptcp_parse_option()
286 mp_opt->addr.port = htons(get_unaligned_be16(ptr)); in mptcp_parse_option()
291 if (!mp_opt->echo) { in mptcp_parse_option()
292 mp_opt->ahmac = get_unaligned_be64(ptr); in mptcp_parse_option()
296 (mp_opt->addr.family == AF_INET6) ? "6" : "", in mptcp_parse_option()
297 mp_opt->addr.id, mp_opt->ahmac, mp_opt->echo, ntohs(mp_opt->addr.port)); in mptcp_parse_option()
307 mp_opt->suboptions |= OPTION_MPTCP_RM_ADDR; in mptcp_parse_option()
308 mp_opt->rm_list.nr = opsize - TCPOLEN_MPTCP_RM_ADDR_BASE; in mptcp_parse_option()
309 for (i = 0; i < mp_opt->rm_list.nr; i++) in mptcp_parse_option()
310 mp_opt->rm_list.ids[i] = *ptr++; in mptcp_parse_option()
311 pr_debug("RM_ADDR: rm_list_nr=%d", mp_opt->rm_list.nr); in mptcp_parse_option()
318 mp_opt->suboptions |= OPTION_MPTCP_PRIO; in mptcp_parse_option()
319 mp_opt->backup = *ptr++ & MPTCP_PRIO_BKUP; in mptcp_parse_option()
320 pr_debug("MP_PRIO: prio=%d", mp_opt->backup); in mptcp_parse_option()
328 mp_opt->rcvr_key = get_unaligned_be64(ptr); in mptcp_parse_option()
330 mp_opt->suboptions |= OPTION_MPTCP_FASTCLOSE; in mptcp_parse_option()
331 pr_debug("MP_FASTCLOSE: recv_key=%llu", mp_opt->rcvr_key); in mptcp_parse_option()
341 mp_opt->suboptions |= OPTION_MPTCP_RST; in mptcp_parse_option()
343 mp_opt->reset_transient = flags & MPTCP_RST_TRANSIENT; in mptcp_parse_option()
344 mp_opt->reset_reason = *ptr; in mptcp_parse_option()
346 mp_opt->reset_transient, mp_opt->reset_reason); in mptcp_parse_option()
354 mp_opt->suboptions |= OPTION_MPTCP_FAIL; in mptcp_parse_option()
355 mp_opt->fail_seq = get_unaligned_be64(ptr); in mptcp_parse_option()
356 pr_debug("MP_FAIL: data_seq=%llu", mp_opt->fail_seq); in mptcp_parse_option()
365 struct mptcp_options_received *mp_opt) in mptcp_get_options() argument
372 mp_opt->suboptions = 0; in mptcp_get_options()
396 mptcp_parse_option(skb, ptr, opsize, mp_opt); in mptcp_get_options()
927 struct mptcp_options_received *mp_opt) in check_fully_established() argument
939 subflow->mp_join && (mp_opt->suboptions & OPTIONS_MPTCP_MPJ) && in check_fully_established()
953 if (subflow->is_mptfo && mp_opt->suboptions & OPTION_MPTCP_MPC_ACK) in check_fully_established()
959 (((mp_opt->suboptions & OPTION_MPTCP_DSS) && mp_opt->use_ack) || in check_fully_established()
960 ((mp_opt->suboptions & OPTION_MPTCP_ADD_ADDR) && !mp_opt->echo))) { in check_fully_established()
973 if (!(mp_opt->suboptions & OPTIONS_MPTCP_MPC)) { in check_fully_established()
982 if (mp_opt->deny_join_id0) in check_fully_established()
988 mptcp_subflow_fully_established(subflow, mp_opt); in check_fully_established()
1037 struct mptcp_options_received *mp_opt) in ack_update_msk() argument
1050 new_snd_una = mptcp_expand_seq(old_snd_una, mp_opt->data_ack, mp_opt->ack64); in ack_update_msk()
1071 trace_ack_update_msk(mp_opt->data_ack, in ack_update_msk()
1094 struct mptcp_options_received *mp_opt) in add_addr_hmac_valid() argument
1098 if (mp_opt->echo) in add_addr_hmac_valid()
1103 &mp_opt->addr); in add_addr_hmac_valid()
1106 msk, hmac, mp_opt->ahmac); in add_addr_hmac_valid()
1108 return hmac == mp_opt->ahmac; in add_addr_hmac_valid()
1116 struct mptcp_options_received mp_opt; in mptcp_incoming_options() local
1139 mptcp_get_options(skb, &mp_opt); in mptcp_incoming_options()
1144 if (!check_fully_established(msk, sk, subflow, skb, &mp_opt)) in mptcp_incoming_options()
1147 if (unlikely(mp_opt.suboptions != OPTION_MPTCP_DSS)) { in mptcp_incoming_options()
1148 if ((mp_opt.suboptions & OPTION_MPTCP_FASTCLOSE) && in mptcp_incoming_options()
1149 msk->local_key == mp_opt.rcvr_key) { in mptcp_incoming_options()
1155 if ((mp_opt.suboptions & OPTION_MPTCP_ADD_ADDR) && in mptcp_incoming_options()
1156 add_addr_hmac_valid(msk, &mp_opt)) { in mptcp_incoming_options()
1157 if (!mp_opt.echo) { in mptcp_incoming_options()
1158 mptcp_pm_add_addr_received(sk, &mp_opt.addr); in mptcp_incoming_options()
1161 mptcp_pm_add_addr_echoed(msk, &mp_opt.addr); in mptcp_incoming_options()
1162 mptcp_pm_del_add_timer(msk, &mp_opt.addr, true); in mptcp_incoming_options()
1166 if (mp_opt.addr.port) in mptcp_incoming_options()
1170 if (mp_opt.suboptions & OPTION_MPTCP_RM_ADDR) in mptcp_incoming_options()
1171 mptcp_pm_rm_addr_received(msk, &mp_opt.rm_list); in mptcp_incoming_options()
1173 if (mp_opt.suboptions & OPTION_MPTCP_PRIO) { in mptcp_incoming_options()
1174 mptcp_pm_mp_prio_received(sk, mp_opt.backup); in mptcp_incoming_options()
1178 if (mp_opt.suboptions & OPTION_MPTCP_FAIL) { in mptcp_incoming_options()
1179 mptcp_pm_mp_fail_received(sk, mp_opt.fail_seq); in mptcp_incoming_options()
1183 if (mp_opt.suboptions & OPTION_MPTCP_RST) { in mptcp_incoming_options()
1185 subflow->reset_reason = mp_opt.reset_reason; in mptcp_incoming_options()
1186 subflow->reset_transient = mp_opt.reset_transient; in mptcp_incoming_options()
1190 if (!(mp_opt.suboptions & OPTION_MPTCP_DSS)) in mptcp_incoming_options()
1197 if (mp_opt.use_ack) in mptcp_incoming_options()
1198 ack_update_msk(msk, sk, &mp_opt); in mptcp_incoming_options()
1206 if (mp_opt.data_fin && mp_opt.data_len == 1 && in mptcp_incoming_options()
1207 mptcp_update_rcv_data_fin(msk, mp_opt.data_seq, mp_opt.dsn64)) in mptcp_incoming_options()
1219 if (likely(mp_opt.use_map)) { in mptcp_incoming_options()
1220 if (mp_opt.mpc_map) { in mptcp_incoming_options()
1232 mpext->data_seq = mp_opt.data_seq; in mptcp_incoming_options()
1233 mpext->subflow_seq = mp_opt.subflow_seq; in mptcp_incoming_options()
1234 mpext->dsn64 = mp_opt.dsn64; in mptcp_incoming_options()
1235 mpext->data_fin = mp_opt.data_fin; in mptcp_incoming_options()
1237 mpext->data_len = mp_opt.data_len; in mptcp_incoming_options()
1239 mpext->csum_reqd = !!(mp_opt.suboptions & OPTION_MPTCP_CSUMREQD); in mptcp_incoming_options()
1242 mpext->csum = mp_opt.csum; in mptcp_incoming_options()