summaryrefslogtreecommitdiffstats
path: root/net/mptcp/pm.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@gmail.com>2020-12-09 15:51:24 -0800
committerDavid S. Miller <davem@davemloft.net>2020-12-09 19:02:15 -0800
commit0f5c9e3f079f1d0355fd8f5e5ec7e3ada095eef4 (patch)
tree3868d18f210e37e4a4d4a824f7e05a407d078ab1 /net/mptcp/pm.c
parentfbe0f87ac7710de31f9c37280b08e0d0d43aa6bf (diff)
downloadlinux-stable-0f5c9e3f079f1d0355fd8f5e5ec7e3ada095eef4.tar.gz
linux-stable-0f5c9e3f079f1d0355fd8f5e5ec7e3ada095eef4.tar.bz2
linux-stable-0f5c9e3f079f1d0355fd8f5e5ec7e3ada095eef4.zip
mptcp: add port parameter for mptcp_pm_announce_addr
This patch added a new parameter 'port' for mptcp_pm_announce_addr. If this parameter is true, we set the MPTCP_ADD_ADDR_PORT bit of the add_addr_signal. That means the announced address is added with a port number. 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/pm.c')
-rw-r--r--net/mptcp/pm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 0c456747893e..e63e14f4cf2a 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -14,7 +14,7 @@
int mptcp_pm_announce_addr(struct mptcp_sock *msk,
const struct mptcp_addr_info *addr,
- bool echo)
+ bool echo, bool port)
{
u8 add_addr = READ_ONCE(msk->pm.add_addr_signal);
@@ -26,6 +26,8 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk,
add_addr |= BIT(MPTCP_ADD_ADDR_ECHO);
if (addr->family == AF_INET6)
add_addr |= BIT(MPTCP_ADD_ADDR_IPV6);
+ if (port)
+ add_addr |= BIT(MPTCP_ADD_ADDR_PORT);
WRITE_ONCE(msk->pm.add_addr_signal, add_addr);
return 0;
}
@@ -156,7 +158,7 @@ void mptcp_pm_add_addr_received(struct mptcp_sock *msk,
spin_lock_bh(&pm->lock);
if (!READ_ONCE(pm->accept_addr)) {
- mptcp_pm_announce_addr(msk, addr, true);
+ mptcp_pm_announce_addr(msk, addr, true, addr->port);
mptcp_pm_add_addr_send_ack(msk);
} else if (mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_RECEIVED)) {
pm->remote = *addr;