MPTCP Linux Development
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [MPTCP][PATCH v2 mptcp-next 7/7] mptcp: drop unnecessary CONFIG_MPTCP_IPV6
Date: Tue, 16 Mar 2021 17:55:46 -0700	[thread overview]
Message-ID: <3885dfb7-8772-cfa2-88a7-4beba08741f8@linux.intel.com> (raw)
In-Reply-To: a9e630765f70579375d3faf731e4b62d78fd1dfa.1615878331.git.geliangtang@gmail.com

[-- Attachment #1: Type: text/plain, Size: 3143 bytes --]

On Tue, 16 Mar 2021, Geliang Tang wrote:

> This patch dropped all the unnecessary '#if IS_ENABLED(CONFIG_MPTCP_IPV6)'
> and '#endif'.
>

If IPV6 is not enabled, what's the benefit of including the extra IPV6 
code? I can see a possible benefit to parsing and sending echo responses 
to peers that might send ADD_ADDR with IPv6 (because they would not know 
that the other peer does not have IPv6 enabled), but I don't think that 
accounts for all the removals in this commit. It would help to explain the 
motivation in the commit message!

Thanks,

Mat


> Signed-off-by: Geliang Tang <geliangtang(a)gmail.com>
> ---
> net/mptcp/options.c    | 6 ------
> net/mptcp/pm_netlink.c | 8 +-------
> 2 files changed, 1 insertion(+), 13 deletions(-)
>
> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index e3fcd2b0ffd7..913cfc83bae4 100644
> --- a/net/mptcp/options.c
> +++ b/net/mptcp/options.c
> @@ -221,22 +221,18 @@ static void mptcp_parse_option(const struct sk_buff *skb,
> 			if (opsize == TCPOLEN_MPTCP_ADD_ADDR ||
> 			    opsize == TCPOLEN_MPTCP_ADD_ADDR_PORT)
> 				mp_opt->addr.family = AF_INET;
> -#if IS_ENABLED(CONFIG_MPTCP_IPV6)
> 			else if (opsize == TCPOLEN_MPTCP_ADD_ADDR6 ||
> 				 opsize == TCPOLEN_MPTCP_ADD_ADDR6_PORT)
> 				mp_opt->addr.family = AF_INET6;
> -#endif
> 			else
> 				break;
> 		} else {
> 			if (opsize == TCPOLEN_MPTCP_ADD_ADDR_BASE ||
> 			    opsize == TCPOLEN_MPTCP_ADD_ADDR_BASE_PORT)
> 				mp_opt->addr.family = AF_INET;
> -#if IS_ENABLED(CONFIG_MPTCP_IPV6)
> 			else if (opsize == TCPOLEN_MPTCP_ADD_ADDR6_BASE ||
> 				 opsize == TCPOLEN_MPTCP_ADD_ADDR6_BASE_PORT)
> 				mp_opt->addr.family = AF_INET6;
> -#endif
> 			else
> 				break;
> 		}
> @@ -1155,10 +1151,8 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
> 		u8 len = TCPOLEN_MPTCP_ADD_ADDR_BASE;
> 		u8 echo = MPTCP_ADDR_ECHO;
>
> -#if IS_ENABLED(CONFIG_MPTCP_IPV6)
> 		if (opts->addr.family == AF_INET6)
> 			len = TCPOLEN_MPTCP_ADD_ADDR6_BASE;
> -#endif
>
> 		if (opts->addr.port)
> 			len += TCPOLEN_MPTCP_PORT_LEN;
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index 181d8048cac1..5691ad101a95 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -889,10 +889,8 @@ static const struct nla_policy mptcp_pm_policy[MPTCP_PM_ATTR_MAX + 1] = {
>
> static int mptcp_pm_family_to_addr(int family)
> {
> -#if IS_ENABLED(CONFIG_MPTCP_IPV6)
> 	if (family == AF_INET6)
> 		return MPTCP_PM_ADDR_ATTR_ADDR6;
> -#endif
> 	return MPTCP_PM_ADDR_ATTR_ADDR4;
> }
>
> @@ -925,11 +923,7 @@ static int mptcp_pm_parse_addr(struct nlattr *attr, struct genl_info *info,
> 	}
>
> 	entry->addr.family = nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_FAMILY]);
> -	if (entry->addr.family != AF_INET
> -#if IS_ENABLED(CONFIG_MPTCP_IPV6)
> -	    && entry->addr.family != AF_INET6
> -#endif
> -	    ) {
> +	if (entry->addr.family != AF_INET && entry->addr.family != AF_INET6) {
> 		NL_SET_ERR_MSG_ATTR(info->extack, attr,
> 				    "unknown address family");
> 		return -EINVAL;
> -- 
> 2.30.2

--
Mat Martineau
Intel

                 reply	other threads:[~2021-03-17  0:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3885dfb7-8772-cfa2-88a7-4beba08741f8@linux.intel.com \
    --to=mptcp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox