aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2021-09-17 16:33:19 -0700
committerDavid S. Miller <davem@davemloft.net>2021-09-18 14:20:01 +0100
commit55c42fa7fa331f98062c32799456420930b8bf8c (patch)
tree42ce80bd04e563a3ee02ef07819e49ed253073ab /include
parentmptcp: add new mptcp_fill_diag helper (diff)
downloadlinux-dev-55c42fa7fa331f98062c32799456420930b8bf8c.tar.xz
linux-dev-55c42fa7fa331f98062c32799456420930b8bf8c.zip
mptcp: add MPTCP_INFO getsockopt
Its not compatible with multipath-tcp.org kernel one. 1. The out-of-tree implementation defines a different 'struct mptcp_info', with embedded __user addresses for additional data such as endpoint addresses. 2. Mat Martineau points out that embedded __user addresses doesn't work with BPF_CGROUP_RUN_PROG_GETSOCKOPT() which assumes that copying in optsize bytes from optval provides all data that got copied to userspace. This provides mptcp_info data for the given mptcp socket. Userspace sets optlen to the size of the structure it expects. The kernel updates it to contain the number of bytes that it copied. This allows to append more information to the structure later. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/socket.h1
-rw-r--r--include/uapi/linux/mptcp.h3
2 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 041d6032a348..7612d760b6a9 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -364,6 +364,7 @@ struct ucred {
#define SOL_KCM 281
#define SOL_TLS 282
#define SOL_XDP 283
+#define SOL_MPTCP 284
/* IPX options */
#define IPX_TYPE 1
diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
index f66038b9551f..3e9caeddda7e 100644
--- a/include/uapi/linux/mptcp.h
+++ b/include/uapi/linux/mptcp.h
@@ -193,4 +193,7 @@ enum mptcp_event_attr {
#define MPTCP_RST_EBADPERF 5
#define MPTCP_RST_EMIDDLEBOX 6
+/* MPTCP socket options */
+#define MPTCP_INFO 1
+
#endif /* _UAPI_MPTCP_H */