History

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.

Florian Westphal committed 5 years ago

Commit 55c42fa1 parent 61bc6e83 files · +43 −1Browse files

Showing the changes to include/uapi (1 of 3 files). Show all

Unified · Split

include/uapi/linux/mptcp.h+3−0
@@ -193,4 +193,7 @@ enum mptcp_event_attr { · 192 unmodified lines
193#define MPTCP_RST_EBADPERF 5193#define MPTCP_RST_EBADPERF 5
194#define MPTCP_RST_EMIDDLEBOX 6194#define MPTCP_RST_EMIDDLEBOX 6
195 195
196/* MPTCP socket options */
197#define MPTCP_INFO 1
198
196#endif /* _UAPI_MPTCP_H */199#endif /* _UAPI_MPTCP_H */