mptcp: Add key generation and token tree

Generate the local keys, IDSN, and token when creating a new socket.
Introduce the token tree to track all tokens in use using a radix tree
with the MPTCP token itself as the index.

Override the rebuild_header callback in inet_connection_sock_af_ops for
creating the local key on a new outgoing connection.

Override the init_req callback of tcp_request_sock_ops for creating the
local key on a new incoming connection.

Will be used to obtain the MPTCP parent socket to handle incoming joins.

Co-developed-by: Davide Caratti <>
Signed-off-by: Davide Caratti <>
Co-developed-by: Florian Westphal <>
Signed-off-by: Florian Westphal <>
Co-developed-by: Paolo Abeni <>
Signed-off-by: Paolo Abeni <>
Signed-off-by: Peter Krystad <>
Signed-off-by: Christoph Paasch <>
Signed-off-by: David S. Miller <>
6 files changed