summaryrefslogtreecommitdiff
path: root/net/mptcp
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@gmail.com>2020-12-09 15:51:23 -0800
committerDavid S. Miller <davem@davemloft.net>2020-12-09 19:02:15 -0800
commitfbe0f87ac7710de31f9c37280b08e0d0d43aa6bf (patch)
tree320e1f3d46675c9bc42fc5e03abe45cf62933d1b /net/mptcp
parent4a2777a83406cc87edf08b5c71887d896f628525 (diff)
mptcp: send out dedicated packet for ADD_ADDR using port
The process is similar to that of the ADD_ADDR IPv6, this patch also sent out a pure ack for the ADD_ADDR using port. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp')
-rw-r--r--net/mptcp/options.c3
-rw-r--r--net/mptcp/pm.c3
-rw-r--r--net/mptcp/pm_netlink.c14
3 files changed, 15 insertions, 5 deletions
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index faae58cc7330..9505b11a6577 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -590,7 +590,8 @@ static bool mptcp_established_options_add_addr(struct sock *sk, struct sk_buff *
bool port;
int len;
- if (mptcp_pm_should_add_signal_ipv6(msk) &&
+ if ((mptcp_pm_should_add_signal_ipv6(msk) ||
+ mptcp_pm_should_add_signal_port(msk)) &&
skb && skb_is_tcp_pure_ack(skb)) {
pr_debug("drop other suboptions");
opts->suboptions = 0;
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 6d4be02681fa..0c456747893e 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -167,7 +167,8 @@ void mptcp_pm_add_addr_received(struct mptcp_sock *msk,
void mptcp_pm_add_addr_send_ack(struct mptcp_sock *msk)
{
- if (!mptcp_pm_should_add_signal_ipv6(msk))
+ if (!mptcp_pm_should_add_signal_ipv6(msk) &&
+ !mptcp_pm_should_add_signal_port(msk))
return;
mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_SEND_ACK);
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 03f2c28f11f5..7a0f700e34bb 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -407,7 +407,8 @@ void mptcp_pm_nl_add_addr_send_ack(struct mptcp_sock *msk)
{
struct mptcp_subflow_context *subflow;
- if (!mptcp_pm_should_add_signal_ipv6(msk))
+ if (!mptcp_pm_should_add_signal_ipv6(msk) &&
+ !mptcp_pm_should_add_signal_port(msk))
return;
__mptcp_flush_join_list(msk);
@@ -417,14 +418,21 @@ void mptcp_pm_nl_add_addr_send_ack(struct mptcp_sock *msk)
u8 add_addr;
spin_unlock_bh(&msk->pm.lock);
- pr_debug("send ack for add_addr6");
+ if (mptcp_pm_should_add_signal_ipv6(msk))
+ pr_debug("send ack for add_addr6");
+ if (mptcp_pm_should_add_signal_port(msk))
+ pr_debug("send ack for add_addr_port");
+
lock_sock(ssk);
tcp_send_ack(ssk);
release_sock(ssk);
spin_lock_bh(&msk->pm.lock);
add_addr = READ_ONCE(msk->pm.add_addr_signal);
- add_addr &= ~BIT(MPTCP_ADD_ADDR_IPV6);
+ if (mptcp_pm_should_add_signal_ipv6(msk))
+ add_addr &= ~BIT(MPTCP_ADD_ADDR_IPV6);
+ if (mptcp_pm_should_add_signal_port(msk))
+ add_addr &= ~BIT(MPTCP_ADD_ADDR_PORT);
WRITE_ONCE(msk->pm.add_addr_signal, add_addr);
}
}