提交 2ec72fae 编写于 作者: G Geliang Tang 提交者: David S. Miller

mptcp: use adding up size to get ADD_ADDR length

This patch uses adding up size to get the ADD_ADDR suboption length rather
than returning the ADD_ADDR size constants.
Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 22fb85ff
......@@ -577,10 +577,14 @@ static inline bool mptcp_pm_should_rm_signal(struct mptcp_sock *msk)
static inline unsigned int mptcp_add_addr_len(int family, bool echo)
{
if (family == AF_INET)
return echo ? TCPOLEN_MPTCP_ADD_ADDR_BASE
: TCPOLEN_MPTCP_ADD_ADDR;
return echo ? TCPOLEN_MPTCP_ADD_ADDR6_BASE : TCPOLEN_MPTCP_ADD_ADDR6;
u8 len = TCPOLEN_MPTCP_ADD_ADDR_BASE;
if (family == AF_INET6)
len = TCPOLEN_MPTCP_ADD_ADDR6_BASE;
if (!echo)
len += MPTCPOPT_THMAC_LEN;
return len;
}
bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册