mptcp: send out dedicated ADD_ADDR packet
When ADD_ADDR suboption includes an IPv6 address, the size is 28 octets. It will not fit when other MPTCP suboptions are included in this packet, e.g. DSS. So here we send out an ADD_ADDR dedicated packet to carry only ADD_ADDR suboption, no other MPTCP suboptions. In mptcp_pm_announce_addr, we check whether this is an IPv6 ADD_ADDR. If it is, we set the flag MPTCP_ADD_ADDR_IPV6 to true. Then we call mptcp_pm_nl_add_addr_send_ack to sent out a new pure ACK packet. In mptcp_established_options_add_addr, we check whether this is a pure ACK packet for ADD_ADDR. If it is, we drop all other MPTCP suboptions in this packet, only put ADD_ADDR suboption in it. Suggested-by: Paolo Abeni <pabeni@redhat.com> Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
d91d322a72
commit
84dfe3677a
@@ -24,6 +24,8 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk,
|
||||
add_addr |= BIT(MPTCP_ADD_ADDR_SIGNAL);
|
||||
if (echo)
|
||||
add_addr |= BIT(MPTCP_ADD_ADDR_ECHO);
|
||||
if (addr->family == AF_INET6)
|
||||
add_addr |= BIT(MPTCP_ADD_ADDR_IPV6);
|
||||
WRITE_ONCE(msk->pm.add_addr_signal, add_addr);
|
||||
return 0;
|
||||
}
|
||||
@@ -153,14 +155,24 @@ void mptcp_pm_add_addr_received(struct mptcp_sock *msk,
|
||||
|
||||
spin_lock_bh(&pm->lock);
|
||||
|
||||
if (!READ_ONCE(pm->accept_addr))
|
||||
if (!READ_ONCE(pm->accept_addr)) {
|
||||
mptcp_pm_announce_addr(msk, addr, true);
|
||||
else if (mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_RECEIVED))
|
||||
mptcp_pm_add_addr_send_ack(msk);
|
||||
} else if (mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_RECEIVED)) {
|
||||
pm->remote = *addr;
|
||||
}
|
||||
|
||||
spin_unlock_bh(&pm->lock);
|
||||
}
|
||||
|
||||
void mptcp_pm_add_addr_send_ack(struct mptcp_sock *msk)
|
||||
{
|
||||
if (!mptcp_pm_should_add_signal_ipv6(msk))
|
||||
return;
|
||||
|
||||
mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_SEND_ACK);
|
||||
}
|
||||
|
||||
void mptcp_pm_rm_addr_received(struct mptcp_sock *msk, u8 rm_id)
|
||||
{
|
||||
struct mptcp_pm_data *pm = &msk->pm;
|
||||
|
||||
Reference in New Issue
Block a user