[PATCH mptcp-next v5 05/11] mptcp: skip ip6 options on v4-mapped clone

Geliang Tang <[email protected]>
Newsgroups dev.linux.lists.mptcp
Message-ID <93de8a870e49441c35ef2f2836613d5f91a24b67.1786159812.git.tanggeliang@kylinos.cn>
From: Geliang Tang <[email protected]>

v4-mapped IPv6 destinations carry no IPv6-specific options, so skip
mptcp_copy_ip6_options() when sk_v6_daddr is in ::ffff:0:0/96. Native
IPv6 subflows are unchanged.

Signed-off-by: Geliang Tang <[email protected]>
---
 net/mptcp/protocol.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index c2762d74f29d..f19777c04d32 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -3750,7 +3750,8 @@ struct sock *mptcp_sk_clone_init(const struct sock *sk,
 	__mptcp_init_sock(nsk);
 
 #if IS_ENABLED(CONFIG_MPTCP_IPV6)
-	if (nsk->sk_family == AF_INET6)
+	if (nsk->sk_family == AF_INET6 &&
+	    !ipv6_addr_v4mapped(&nsk->sk_v6_daddr))
 		mptcp_copy_ip6_options(nsk, sk);
 	else
 #endif
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.