Hi Matt,

Matthieu Baerts <matthieu.baerts@tessares.net> 于2020年11月4日周三 上午1:23写道:
On 31/10/2020 16:24, Geliang Tang wrote:
> This patch uses adding up size to get the ADD_ADDR suboption length rather
> than returning the ADD_ADDR size constants.
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
>   net/mptcp/protocol.h | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index f303c46bcc29..ad3fdec98fdc 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -546,10 +546,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 += 8; // Truncated HMAC

I don't think these comments with "//" are accepted. Instead, should we
not declare a new constant, e.g. TCPOLEN_MPTCP_ADD_ADDR_HMAC?


Thanks, I'll fix this in the next version.

-Geliang
 
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net