Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /* Multipath TCP
0003  *
0004  * Copyright (c) 2020, Tessares SA.
0005  * Copyright (c) 2022, SUSE.
0006  *
0007  * Author: Nicolas Rybowski <nicolas.rybowski@tessares.net>
0008  */
0009 
0010 #define pr_fmt(fmt) "MPTCP: " fmt
0011 
0012 #include <linux/bpf.h>
0013 #include "protocol.h"
0014 
0015 struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk)
0016 {
0017     if (sk && sk_fullsock(sk) && sk->sk_protocol == IPPROTO_TCP && sk_is_mptcp(sk))
0018         return mptcp_sk(mptcp_subflow_ctx(sk)->conn);
0019 
0020     return NULL;
0021 }