mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
mptcp: pass right struct to subflow_hmac_valid
subflow_hmac_valid() needs to access the MPTCP socket and the subflow request, but not the request sock that is passed in argument. Instead, the subflow request can be directly passed to avoid getting it via an additional cast. Reviewed-by: Geliang Tang <geliang@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20250413-net-next-mptcp-sched-mib-sft-misc-v2-4-0f83a4350150@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
def9d0958b
commit
60cbf31585
|
|
@ -745,15 +745,11 @@ struct request_sock *mptcp_subflow_reqsk_alloc(const struct request_sock_ops *op
|
|||
EXPORT_SYMBOL(mptcp_subflow_reqsk_alloc);
|
||||
|
||||
/* validate hmac received in third ACK */
|
||||
static bool subflow_hmac_valid(const struct request_sock *req,
|
||||
static bool subflow_hmac_valid(const struct mptcp_subflow_request_sock *subflow_req,
|
||||
const struct mptcp_options_received *mp_opt)
|
||||
{
|
||||
const struct mptcp_subflow_request_sock *subflow_req;
|
||||
struct mptcp_sock *msk = subflow_req->msk;
|
||||
u8 hmac[SHA256_DIGEST_SIZE];
|
||||
struct mptcp_sock *msk;
|
||||
|
||||
subflow_req = mptcp_subflow_rsk(req);
|
||||
msk = subflow_req->msk;
|
||||
|
||||
subflow_generate_hmac(READ_ONCE(msk->remote_key),
|
||||
READ_ONCE(msk->local_key),
|
||||
|
|
@ -899,7 +895,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
|
|||
goto dispose_child;
|
||||
}
|
||||
|
||||
if (!subflow_hmac_valid(req, &mp_opt)) {
|
||||
if (!subflow_hmac_valid(subflow_req, &mp_opt)) {
|
||||
SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINACKMAC);
|
||||
subflow_add_reset_reason(skb, MPTCP_RST_EPROHIBIT);
|
||||
goto dispose_child;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user