Commit fbe0f87a authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller

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: default avatarGeliang Tang <geliangtang@gmail.com>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4a2777a8
...@@ -590,7 +590,8 @@ static bool mptcp_established_options_add_addr(struct sock *sk, struct sk_buff * ...@@ -590,7 +590,8 @@ static bool mptcp_established_options_add_addr(struct sock *sk, struct sk_buff *
bool port; bool port;
int len; 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)) { skb && skb_is_tcp_pure_ack(skb)) {
pr_debug("drop other suboptions"); pr_debug("drop other suboptions");
opts->suboptions = 0; opts->suboptions = 0;
......
...@@ -167,7 +167,8 @@ void mptcp_pm_add_addr_received(struct mptcp_sock *msk, ...@@ -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) 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; return;
mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_SEND_ACK); mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_SEND_ACK);
......
...@@ -407,7 +407,8 @@ void mptcp_pm_nl_add_addr_send_ack(struct mptcp_sock *msk) ...@@ -407,7 +407,8 @@ void mptcp_pm_nl_add_addr_send_ack(struct mptcp_sock *msk)
{ {
struct mptcp_subflow_context *subflow; 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; return;
__mptcp_flush_join_list(msk); __mptcp_flush_join_list(msk);
...@@ -417,14 +418,21 @@ void mptcp_pm_nl_add_addr_send_ack(struct mptcp_sock *msk) ...@@ -417,14 +418,21 @@ void mptcp_pm_nl_add_addr_send_ack(struct mptcp_sock *msk)
u8 add_addr; u8 add_addr;
spin_unlock_bh(&msk->pm.lock); 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); lock_sock(ssk);
tcp_send_ack(ssk); tcp_send_ack(ssk);
release_sock(ssk); release_sock(ssk);
spin_lock_bh(&msk->pm.lock); spin_lock_bh(&msk->pm.lock);
add_addr = READ_ONCE(msk->pm.add_addr_signal); 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); WRITE_ONCE(msk->pm.add_addr_signal, add_addr);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment