Skip to content

Commit

Permalink
mptcp: map v4 address to v6 when destroying subflow
Browse files Browse the repository at this point in the history
In mptcp_pm_nl_subflow_destroy_doit(), before checking local address
family with remote address family, map an IPv4 address to an IPv6 address
if the pair is a v4-mapped address.

Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
geliangtang authored and intel-lab-lkp committed Nov 28, 2023
1 parent 9067324 commit 3b4a8a8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions net/mptcp/pm_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,16 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info
goto destroy_err;
}

#if IS_ENABLED(CONFIG_MPTCP_IPV6)
if (addr_l.family == AF_INET && ipv6_addr_v4mapped(&addr_r.addr6)) {
ipv6_addr_set_v4mapped(addr_l.addr.s_addr, &addr_l.addr6);
addr_l.family = AF_INET6;
}
if (addr_r.family == AF_INET && ipv6_addr_v4mapped(&addr_l.addr6)) {
ipv6_addr_set_v4mapped(addr_r.addr.s_addr, &addr_r.addr6);
addr_r.family = AF_INET6;
}
#endif
if (addr_l.family != addr_r.family) {
GENL_SET_ERR_MSG(info, "address families do not match");
err = -EINVAL;
Expand Down

0 comments on commit 3b4a8a8

Please sign in to comment.