]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: add MPTCP_INFO getsockopt
authorFlorian Westphal <fw@strlen.de>
Fri, 17 Sep 2021 23:33:19 +0000 (16:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 18 Sep 2021 13:20:01 +0000 (14:20 +0100)
commit75b4d7cb3ee163155ad31fcb145e16f849cccc91
tree42ce80bd04e563a3ee02ef07819e49ed253073ab
parent152e1b564452e16f570b456eab1a65f44eece58a
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>
include/linux/socket.h
include/uapi/linux/mptcp.h
net/mptcp/sockopt.c