Skip to content

Commit

Permalink
mptcp: use adding up size to get ADD_ADDR length
Browse files Browse the repository at this point in the history
This patch uses adding up size to get the ADD_ADDR suboption length rather
than returning the ADD_ADDR size constants.

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
  • Loading branch information
geliangtang authored and jenkins-tessares committed Dec 9, 2020
1 parent 1690597 commit a8787a8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions net/mptcp/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,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,
Expand Down

0 comments on commit a8787a8

Please sign in to comment.