Lines Matching refs:subflow_req
40 struct mptcp_subflow_request_sock *subflow_req = mptcp_subflow_rsk(req); in subflow_req_destructor() local
42 pr_debug("subflow_req=%p", subflow_req); in subflow_req_destructor()
44 if (subflow_req->msk) in subflow_req_destructor()
45 sock_put((struct sock *)subflow_req->msk); in subflow_req_destructor()
71 static void subflow_req_create_thmac(struct mptcp_subflow_request_sock *subflow_req) in subflow_req_create_thmac() argument
73 struct mptcp_sock *msk = subflow_req->msk; in subflow_req_create_thmac()
76 get_random_bytes(&subflow_req->local_nonce, sizeof(u32)); in subflow_req_create_thmac()
79 subflow_req->local_nonce, in subflow_req_create_thmac()
80 subflow_req->remote_nonce, hmac); in subflow_req_create_thmac()
82 subflow_req->thmac = get_unaligned_be64(hmac); in subflow_req_create_thmac()
87 struct mptcp_subflow_request_sock *subflow_req = mptcp_subflow_rsk(req); in subflow_token_join_request() local
91 msk = mptcp_token_get_sock(sock_net(req_to_sk(req)), subflow_req->token); in subflow_token_join_request()
102 subflow_req->local_id = local_id; in subflow_token_join_request()
109 struct mptcp_subflow_request_sock *subflow_req = mptcp_subflow_rsk(req); in subflow_init_req() local
111 subflow_req->mp_capable = 0; in subflow_init_req()
112 subflow_req->mp_join = 0; in subflow_init_req()
113 subflow_req->csum_reqd = mptcp_is_checksum_enabled(sock_net(sk_listener)); in subflow_init_req()
114 subflow_req->allow_join_id0 = mptcp_allow_join_id0(sock_net(sk_listener)); in subflow_init_req()
115 subflow_req->msk = NULL; in subflow_init_req()
144 struct mptcp_subflow_request_sock *subflow_req = mptcp_subflow_rsk(req); in subflow_check_req() local
148 pr_debug("subflow_req=%p, listener=%p", subflow_req, listener); in subflow_check_req()
174 subflow_req->ssn_offset = TCP_SKB_CB(skb)->seq; in subflow_check_req()
177 get_random_bytes(&subflow_req->local_key, sizeof(subflow_req->local_key)); in subflow_check_req()
178 } while (subflow_req->local_key == 0); in subflow_check_req()
181 mptcp_crypto_key_sha(subflow_req->local_key, in subflow_check_req()
182 &subflow_req->token, in subflow_check_req()
183 &subflow_req->idsn); in subflow_check_req()
184 if (mptcp_token_exists(subflow_req->token)) { in subflow_check_req()
189 subflow_req->mp_capable = 1; in subflow_check_req()
196 subflow_req->mp_capable = 1; in subflow_check_req()
203 subflow_req->ssn_offset = TCP_SKB_CB(skb)->seq; in subflow_check_req()
204 subflow_req->mp_join = 1; in subflow_check_req()
205 subflow_req->backup = mp_opt.backup; in subflow_check_req()
206 subflow_req->remote_id = mp_opt.join_id; in subflow_check_req()
207 subflow_req->token = mp_opt.token; in subflow_check_req()
208 subflow_req->remote_nonce = mp_opt.nonce; in subflow_check_req()
209 subflow_req->msk = subflow_token_join_request(req); in subflow_check_req()
212 if (!subflow_req->msk) { in subflow_check_req()
217 if (subflow_use_different_sport(subflow_req->msk, sk_listener)) { in subflow_check_req()
220 ntohs(inet_sk((struct sock *)subflow_req->msk)->inet_sport)); in subflow_check_req()
221 if (!mptcp_pm_sport_in_anno_list(subflow_req->msk, sk_listener)) { in subflow_check_req()
228 subflow_req_create_thmac(subflow_req); in subflow_check_req()
231 if (mptcp_can_accept_new_subflow(subflow_req->msk)) in subflow_check_req()
232 subflow_init_req_cookie_join_save(subflow_req, skb); in subflow_check_req()
237 pr_debug("token=%u, remote_nonce=%u msk=%p", subflow_req->token, in subflow_check_req()
238 subflow_req->remote_nonce, subflow_req->msk); in subflow_check_req()
249 struct mptcp_subflow_request_sock *subflow_req = mptcp_subflow_rsk(req); in mptcp_subflow_init_cookie_req() local
266 subflow_req->local_key = mp_opt.rcvr_key; in mptcp_subflow_init_cookie_req()
271 subflow_req->mp_capable = 1; in mptcp_subflow_init_cookie_req()
272 subflow_req->ssn_offset = TCP_SKB_CB(skb)->seq - 1; in mptcp_subflow_init_cookie_req()
274 if (!mptcp_token_join_cookie_init_state(subflow_req, skb)) in mptcp_subflow_init_cookie_req()
277 subflow_req->mp_join = 1; in mptcp_subflow_init_cookie_req()
278 subflow_req->ssn_offset = TCP_SKB_CB(skb)->seq - 1; in mptcp_subflow_init_cookie_req()
589 const struct mptcp_subflow_request_sock *subflow_req; in subflow_hmac_valid() local
593 subflow_req = mptcp_subflow_rsk(req); in subflow_hmac_valid()
594 msk = subflow_req->msk; in subflow_hmac_valid()
599 subflow_req->remote_nonce, in subflow_hmac_valid()
600 subflow_req->local_nonce, hmac); in subflow_hmac_valid()
682 struct mptcp_subflow_request_sock *subflow_req; in subflow_syn_recv_sock() local
696 subflow_req = mptcp_subflow_rsk(req); in subflow_syn_recv_sock()
697 fallback_is_fatal = tcp_rsk(req)->is_mptcp && subflow_req->mp_join; in subflow_syn_recv_sock()
703 if (subflow_req->mp_capable) { in subflow_syn_recv_sock()
721 } else if (subflow_req->mp_join) { in subflow_syn_recv_sock()
725 !mptcp_can_accept_new_subflow(subflow_req->msk)) { in subflow_syn_recv_sock()
774 mptcp_token_accept(subflow_req, mptcp_sk(new_msk)); in subflow_syn_recv_sock()
786 owner = subflow_req->msk; in subflow_syn_recv_sock()
793 subflow_req->msk = NULL; in subflow_syn_recv_sock()
1847 struct mptcp_subflow_request_sock *subflow_req = mptcp_subflow_rsk(req); in subflow_ulp_clone() local
1852 (!subflow_req->mp_capable && !subflow_req->mp_join)) { in subflow_ulp_clone()
1870 if (subflow_req->mp_capable) { in subflow_ulp_clone()
1875 new_ctx->local_key = subflow_req->local_key; in subflow_ulp_clone()
1876 new_ctx->token = subflow_req->token; in subflow_ulp_clone()
1877 new_ctx->ssn_offset = subflow_req->ssn_offset; in subflow_ulp_clone()
1878 new_ctx->idsn = subflow_req->idsn; in subflow_ulp_clone()
1882 } else if (subflow_req->mp_join) { in subflow_ulp_clone()
1883 new_ctx->ssn_offset = subflow_req->ssn_offset; in subflow_ulp_clone()
1886 new_ctx->backup = subflow_req->backup; in subflow_ulp_clone()
1887 new_ctx->remote_id = subflow_req->remote_id; in subflow_ulp_clone()
1888 new_ctx->token = subflow_req->token; in subflow_ulp_clone()
1889 new_ctx->thmac = subflow_req->thmac; in subflow_ulp_clone()
1894 subflow_set_local_id(new_ctx, subflow_req->local_id); in subflow_ulp_clone()