OSDN Git Service

mptcp: support MPJoin with IPv4 mapped in v6 sk
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Mon, 25 Jan 2021 18:59:00 +0000 (10:59 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 28 Jan 2021 00:53:47 +0000 (16:53 -0800)
commit50a13bc3945c9004cf418d181d55ec54cfe4c8ec
tree304a2ee7651c5641589e04277286ae8a093913db
parent17ce76c4985f166572c7870b86b41dae7b95cb9e
mptcp: support MPJoin with IPv4 mapped in v6 sk

With an IPv4 mapped in v6 socket, we were trying to call inet6_bind()
with an IPv4 address resulting in a -EINVAL error because the given
addr_len -- size of the address structure -- was too short.

We now make sure to use address structures for the same family as the
MPTCP socket for both the bind() and the connect(). It means we convert
v4 addresses to v4 mapped in v6 or the opposite if needed.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/122
Co-developed-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/subflow.c