mptcp: let the in-kernel PM use mixed IPv4 and IPv6 addresses
authorPaolo Abeni <pabeni@redhat.com>
Wed, 25 Jan 2023 10:47:21 +0000 (11:47 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 26 Jan 2023 12:33:30 +0000 (13:33 +0100)
commitb9d69db87fb77fc80997993d40f091b323b3651e
tree4ff7aeb4fe727c170e0ca1e5bf0b137c258c8d9b
parentd0941130c93515411c8d66fc22bdae407b509a6d
mptcp: let the in-kernel PM use mixed IPv4 and IPv6 addresses

Currently the in-kernel PM arbitrary enforces that created subflow's
family must match the main MPTCP socket while the RFC allows mixing
IPv4 and IPv6 subflows.

This patch changes the in-kernel PM logic to create subflows matching
the currently selected source (or destination) address. IPv4 sockets
can pick only IPv4 addresses (and v4 mapped in v6), while IPv6 sockets
not restricted to V6ONLY can pick either IPv4 and IPv6 addresses as
long as the source and destination matches.

A helper, previously introduced is used to ease family matching checks,
taking care of IPv4 vs IPv4-mapped-IPv6 vs IPv6 only addresses.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/269
Co-developed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/mptcp/pm_netlink.c