[PATCH mptcp-next 17/21] mptcp: netlink: allow userspace-driven subflow establishment

Kishen Maloor posted 21 patches 3 years, 9 months ago
Maintainers: Matthieu Baerts <matthieu.baerts@tessares.net>, Mat Martineau <mathew.j.martineau@linux.intel.com>, Shuah Khan <shuah@kernel.org>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
There is a newer version of this series
[PATCH mptcp-next 17/21] mptcp: netlink: allow userspace-driven subflow establishment
Posted by Kishen Maloor 3 years, 9 months ago
From: Florian Westphal <fw@strlen.de>

This allows userspace to tell kernel to add a new subflow to an existing
mptcp connection.

Userspace provides the token to identify the mptcp-level connection
that needs a change in active subflows and the local and remote
addresses of the new or the to-be-removed subflow.

MPTCP_PM_CMD_SUBFLOW_CREATE requires the following parameters:
{ token, { loc_id, family, loc_addr4 | loc_addr6 }, { family, rem_addr4 |
rem_addr6, rem_port }

MPTCP_PM_CMD_SUBFLOW_DESTROY requires the following parameters:
{ token, { family, loc_addr4 | loc_addr6, loc_port }, { family, rem_addr4 |
rem_addr6, rem_port }

Signed-off-by: Florian Westphal <fw@strlen.de>
Co-developed-by: Kishen Maloor <kishen.maloor@intel.com>
Signed-off-by: Kishen Maloor <kishen.maloor@intel.com>
---
 include/uapi/linux/mptcp.h |   3 +
 net/mptcp/pm_netlink.c     | 204 +++++++++++++++++++++++++++++++++++++
 2 files changed, 207 insertions(+)

diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
index ec63f9382dbe..25fd6c679bfa 100644
--- a/include/uapi/linux/mptcp.h
+++ b/include/uapi/linux/mptcp.h
@@ -57,6 +57,7 @@ enum {
 	MPTCP_PM_ATTR_SUBFLOWS,				/* u32 */
 	MPTCP_PM_ATTR_TOKEN,				/* u32 */
 	MPTCP_PM_ATTR_LOC_ID,				/* u8 */
+	MPTCP_PM_ATTR_ADDR_REMOTE,			/* nested address */
 
 	__MPTCP_PM_ATTR_MAX
 };
@@ -96,6 +97,8 @@ enum {
 	MPTCP_PM_CMD_SET_FLAGS,
 	MPTCP_PM_CMD_ANNOUNCE,
 	MPTCP_PM_CMD_REMOVE,
+	MPTCP_PM_CMD_SUBFLOW_CREATE,
+	MPTCP_PM_CMD_SUBFLOW_DESTROY,
 
 	__MPTCP_PM_CMD_AFTER_LAST
 };
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 66462ac706f2..26392a6699cd 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1270,6 +1270,8 @@ static const struct nla_policy mptcp_pm_policy[MPTCP_PM_ATTR_MAX + 1] = {
 	[MPTCP_PM_ATTR_SUBFLOWS]	= { .type	= NLA_U32,	},
 	[MPTCP_PM_ATTR_TOKEN]		= { .type	= NLA_U32,	},
 	[MPTCP_PM_ATTR_LOC_ID]		= { .type	= NLA_U8,	},
+	[MPTCP_PM_ATTR_ADDR_REMOTE]	=
+					NLA_POLICY_NESTED(mptcp_pm_addr_policy),
 };
 
 void mptcp_pm_nl_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ssk)
@@ -1379,6 +1381,16 @@ static int mptcp_pm_parse_pm_addr_attr(struct nlattr *tb[],
 	return err;
 }
 
+static int mptcp_pm_parse_addr(struct nlattr *attr, struct genl_info *info,
+			       struct mptcp_addr_info *addr)
+{
+	struct nlattr *tb[MPTCP_PM_ADDR_ATTR_MAX + 1];
+
+	memset(addr, 0, sizeof(*addr));
+
+	return mptcp_pm_parse_pm_addr_attr(tb, attr, info, addr, true);
+}
+
 static int mptcp_pm_parse_entry(struct nlattr *attr, struct genl_info *info,
 				bool require_family,
 				struct mptcp_pm_addr_entry *entry)
@@ -2503,6 +2515,188 @@ void mptcp_event(enum mptcp_event_type type, const struct mptcp_sock *msk,
 	kfree_skb(skb);
 }
 
+static int mptcp_nl_cmd_sf_create(struct sk_buff *skb, struct genl_info *info)
+{
+	struct nlattr *raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
+	struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN];
+	struct nlattr *laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
+	struct mptcp_addr_info addr_r;
+	struct mptcp_addr_info addr_l;
+	struct mptcp_sock *msk;
+	struct sock *sk;
+	u32 token_val;
+	int ret;
+
+	if (!laddr || !raddr || !token) {
+		GENL_SET_ERR_MSG(info, "missing required inputs");
+		return -EINVAL;
+	}
+
+	token_val = nla_get_u32(token);
+
+	msk = mptcp_token_get_sock(genl_info_net(info), token_val);
+	if (!msk) {
+		NL_SET_ERR_MSG_ATTR(info->extack, token, "invalid token");
+		return -EINVAL;
+	}
+
+	if (READ_ONCE(msk->pm.pm_type) != MPTCP_PM_TYPE_USERSPACE) {
+		GENL_SET_ERR_MSG(info, "invalid request; userspace PM not selected");
+		return -EINVAL;
+	}
+
+	ret = mptcp_pm_parse_addr(laddr, info, &addr_l);
+	if (ret < 0) {
+		NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr");
+		return -EINVAL;
+	}
+
+	if (addr_l.id == 0) {
+		NL_SET_ERR_MSG_ATTR(info->extack, laddr, "missing local addr id");
+		return -EINVAL;
+	}
+
+	ret = mptcp_pm_parse_addr(raddr, info, &addr_r);
+	if (ret < 0) {
+		NL_SET_ERR_MSG_ATTR(info->extack, raddr, "error parsing remote addr");
+		return -EINVAL;
+	}
+
+	sk = &msk->sk.icsk_inet.sk;
+	lock_sock(sk);
+
+	ret = __mptcp_subflow_connect(sk, &addr_l, &addr_r);
+
+	spin_lock_bh(&msk->pm.lock);
+	if (ret == 0)
+		msk->pm.local_addr_used++;
+	spin_unlock_bh(&msk->pm.lock);
+
+	release_sock(sk);
+
+	return ret;
+}
+
+static struct sock *mptcp_nl_find_ssk(struct mptcp_sock *msk,
+				      const struct mptcp_addr_info *local,
+				      const struct mptcp_addr_info *remote)
+{
+	struct sock *sk = &msk->sk.icsk_inet.sk;
+	struct mptcp_subflow_context *subflow;
+	struct sock *found = NULL;
+
+	if (local->family != remote->family)
+		return NULL;
+
+	lock_sock(sk);
+
+	mptcp_for_each_subflow(msk, subflow) {
+		const struct ipv6_pinfo *pinfo;
+		const struct inet_sock *issk;
+		struct sock *ssk;
+
+		ssk = mptcp_subflow_tcp_sock(subflow);
+
+		if (local->family != ssk->sk_family)
+			continue;
+
+		issk = inet_sk(ssk);
+
+		switch (ssk->sk_family) {
+		case AF_INET:
+			if (issk->inet_saddr != local->addr.s_addr ||
+			    issk->inet_daddr != remote->addr.s_addr)
+				continue;
+			break;
+		case AF_INET6:
+			pinfo = inet6_sk(ssk);
+			if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
+			    !ipv6_addr_equal(&remote->addr6, &ssk->sk_v6_daddr))
+				continue;
+			break;
+		default:
+			continue;
+		}
+
+		if (issk->inet_sport == local->port &&
+		    issk->inet_dport == remote->port) {
+			found = ssk;
+			goto found;
+		}
+	}
+
+found:
+	release_sock(sk);
+
+	return found;
+}
+
+static int mptcp_nl_cmd_sf_destroy(struct sk_buff *skb, struct genl_info *info)
+{
+	struct nlattr *raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
+	struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN];
+	struct nlattr *laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
+	struct mptcp_addr_info addr_l;
+	struct mptcp_addr_info addr_r;
+	struct mptcp_sock *msk;
+	struct sock *sk, *ssk;
+	u32 token_val;
+	int ret;
+
+	if (!laddr || !raddr || !token) {
+		GENL_SET_ERR_MSG(info, "missing required inputs");
+		return -EINVAL;
+	}
+
+	token_val = nla_get_u32(token);
+
+	msk = mptcp_token_get_sock(genl_info_net(info), token_val);
+	if (!msk) {
+		NL_SET_ERR_MSG_ATTR(info->extack, token, "invalid token");
+		return -EINVAL;
+	}
+
+	if (READ_ONCE(msk->pm.pm_type) != MPTCP_PM_TYPE_USERSPACE) {
+		GENL_SET_ERR_MSG(info, "invalid request; userspace PM not selected");
+		return -EINVAL;
+	}
+
+	ret = mptcp_pm_parse_addr(laddr, info, &addr_l);
+	if (ret < 0) {
+		NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr");
+		return ret;
+	}
+
+	ret = mptcp_pm_parse_addr(raddr, info, &addr_r);
+	if (ret < 0) {
+		NL_SET_ERR_MSG_ATTR(info->extack, raddr, "error parsing remote addr");
+		return ret;
+	}
+
+	if (addr_l.family != addr_r.family) {
+		GENL_SET_ERR_MSG(info, "address families do not match");
+		return -EINVAL;
+	}
+
+	if (!addr_l.port || !addr_r.port) {
+		GENL_SET_ERR_MSG(info, "missing local or remote port");
+		return -EINVAL;
+	}
+
+	sk = &msk->sk.icsk_inet.sk;
+	ssk = mptcp_nl_find_ssk(msk, &addr_l, &addr_r);
+	if (ssk) {
+		struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk);
+
+		mptcp_subflow_shutdown(sk, ssk, RCV_SHUTDOWN | SEND_SHUTDOWN);
+		mptcp_close_ssk(sk, ssk, subflow);
+	} else {
+		ret = -ESRCH;
+	}
+
+	return ret;
+}
+
 static const struct genl_small_ops mptcp_pm_ops[] = {
 	{
 		.cmd    = MPTCP_PM_CMD_ADD_ADDR,
@@ -2548,6 +2742,16 @@ static const struct genl_small_ops mptcp_pm_ops[] = {
 		.doit   = mptcp_nl_cmd_remove,
 		.flags  = GENL_ADMIN_PERM,
 	},
+	{
+		.cmd    = MPTCP_PM_CMD_SUBFLOW_CREATE,
+		.doit   = mptcp_nl_cmd_sf_create,
+		.flags  = GENL_ADMIN_PERM,
+	},
+	{
+		.cmd    = MPTCP_PM_CMD_SUBFLOW_DESTROY,
+		.doit   = mptcp_nl_cmd_sf_destroy,
+		.flags  = GENL_ADMIN_PERM,
+	},
 };
 
 static struct genl_family mptcp_genl_family __ro_after_init = {
-- 
2.31.1


Re: [PATCH mptcp-next 17/21] mptcp: netlink: allow userspace-driven subflow establishment
Posted by kernel test robot 3 years, 9 months ago
Hi Kishen,

I love your patch! Yet something to improve:

[auto build test ERROR on f81a8b95bfe9cae8ff02739e3e263d9310422af7]

url:    https://github.com/0day-ci/linux/commits/Kishen-Maloor/mptcp-support-userspace-path-management/20211217-062636
base:   f81a8b95bfe9cae8ff02739e3e263d9310422af7
config: sparc-randconfig-r004-20211216 (https://download.01.org/0day-ci/archive/20211217/202112171003.GmuMEIxi-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/ece3dbcf3e16211dda7bdeb0f00b2450e776814d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Kishen-Maloor/mptcp-support-userspace-path-management/20211217-062636
        git checkout ece3dbcf3e16211dda7bdeb0f00b2450e776814d
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sparc SHELL=/bin/bash net/mptcp/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   net/mptcp/pm_netlink.c: In function 'mptcp_nl_find_ssk':
>> net/mptcp/pm_netlink.c:2613:54: error: 'const struct mptcp_addr_info' has no member named 'addr6'; did you mean 'addr'?
    2613 |                         if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
         |                                                      ^~~~~
         |                                                      addr
   net/mptcp/pm_netlink.c:2614:55: error: 'const struct mptcp_addr_info' has no member named 'addr6'; did you mean 'addr'?
    2614 |                             !ipv6_addr_equal(&remote->addr6, &ssk->sk_v6_daddr))
         |                                                       ^~~~~
         |                                                       addr


vim +2613 net/mptcp/pm_netlink.c

  2579	
  2580	static struct sock *mptcp_nl_find_ssk(struct mptcp_sock *msk,
  2581					      const struct mptcp_addr_info *local,
  2582					      const struct mptcp_addr_info *remote)
  2583	{
  2584		struct sock *sk = &msk->sk.icsk_inet.sk;
  2585		struct mptcp_subflow_context *subflow;
  2586		struct sock *found = NULL;
  2587	
  2588		if (local->family != remote->family)
  2589			return NULL;
  2590	
  2591		lock_sock(sk);
  2592	
  2593		mptcp_for_each_subflow(msk, subflow) {
  2594			const struct ipv6_pinfo *pinfo;
  2595			const struct inet_sock *issk;
  2596			struct sock *ssk;
  2597	
  2598			ssk = mptcp_subflow_tcp_sock(subflow);
  2599	
  2600			if (local->family != ssk->sk_family)
  2601				continue;
  2602	
  2603			issk = inet_sk(ssk);
  2604	
  2605			switch (ssk->sk_family) {
  2606			case AF_INET:
  2607				if (issk->inet_saddr != local->addr.s_addr ||
  2608				    issk->inet_daddr != remote->addr.s_addr)
  2609					continue;
  2610				break;
  2611			case AF_INET6:
  2612				pinfo = inet6_sk(ssk);
> 2613				if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
  2614				    !ipv6_addr_equal(&remote->addr6, &ssk->sk_v6_daddr))
  2615					continue;
  2616				break;
  2617			default:
  2618				continue;
  2619			}
  2620	
  2621			if (issk->inet_sport == local->port &&
  2622			    issk->inet_dport == remote->port) {
  2623				found = ssk;
  2624				goto found;
  2625			}
  2626		}
  2627	
  2628	found:
  2629		release_sock(sk);
  2630	
  2631		return found;
  2632	}
  2633	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Re: [PATCH mptcp-next 17/21] mptcp: netlink: allow userspace-driven subflow establishment
Posted by kernel test robot 3 years, 9 months ago
Hi Kishen,

I love your patch! Yet something to improve:

[auto build test ERROR on f81a8b95bfe9cae8ff02739e3e263d9310422af7]

url:    https://github.com/0day-ci/linux/commits/Kishen-Maloor/mptcp-support-userspace-path-management/20211217-062636
base:   f81a8b95bfe9cae8ff02739e3e263d9310422af7
config: arc-randconfig-r043-20211216 (https://download.01.org/0day-ci/archive/20211217/202112171344.Zn3aOifg-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/ece3dbcf3e16211dda7bdeb0f00b2450e776814d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Kishen-Maloor/mptcp-support-userspace-path-management/20211217-062636
        git checkout ece3dbcf3e16211dda7bdeb0f00b2450e776814d
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash net/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from arch/arc/include/asm/atomic.h:12,
                    from include/linux/atomic.h:7,
                    from include/net/net_namespace.h:8,
                    from include/linux/inet.h:42,
                    from net/mptcp/pm_netlink.c:9:
   net/mptcp/pm_netlink.c: In function 'mptcp_nl_find_ssk':
>> net/mptcp/pm_netlink.c:2613:54: error: 'const struct mptcp_addr_info' has no member named 'addr6'; did you mean 'addr'?
    2613 |                         if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
         |                                                      ^~~~~
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                    ^~~~
   net/mptcp/pm_netlink.c:2613:25: note: in expansion of macro 'if'
    2613 |                         if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
         |                         ^~
   net/mptcp/pm_netlink.c:2614:55: error: 'const struct mptcp_addr_info' has no member named 'addr6'; did you mean 'addr'?
    2614 |                             !ipv6_addr_equal(&remote->addr6, &ssk->sk_v6_daddr))
         |                                                       ^~~~~
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                    ^~~~
   net/mptcp/pm_netlink.c:2613:25: note: in expansion of macro 'if'
    2613 |                         if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
         |                         ^~
>> include/net/sock.h:388:45: error: 'struct sock_common' has no member named 'skc_v6_daddr'; did you mean 'skc_daddr'?
     388 | #define sk_v6_daddr             __sk_common.skc_v6_daddr
         |                                             ^~~~~~~~~~~~
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                    ^~~~
   net/mptcp/pm_netlink.c:2613:25: note: in expansion of macro 'if'
    2613 |                         if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
         |                         ^~
   net/mptcp/pm_netlink.c:2614:68: note: in expansion of macro 'sk_v6_daddr'
    2614 |                             !ipv6_addr_equal(&remote->addr6, &ssk->sk_v6_daddr))
         |                                                                    ^~~~~~~~~~~
>> net/mptcp/pm_netlink.c:2613:54: error: 'const struct mptcp_addr_info' has no member named 'addr6'; did you mean 'addr'?
    2613 |                         if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
         |                                                      ^~~~~
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                             ^~~~
   net/mptcp/pm_netlink.c:2613:25: note: in expansion of macro 'if'
    2613 |                         if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
         |                         ^~
   net/mptcp/pm_netlink.c:2614:55: error: 'const struct mptcp_addr_info' has no member named 'addr6'; did you mean 'addr'?
    2614 |                             !ipv6_addr_equal(&remote->addr6, &ssk->sk_v6_daddr))
         |                                                       ^~~~~
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                             ^~~~
   net/mptcp/pm_netlink.c:2613:25: note: in expansion of macro 'if'
    2613 |                         if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
         |                         ^~
>> include/net/sock.h:388:45: error: 'struct sock_common' has no member named 'skc_v6_daddr'; did you mean 'skc_daddr'?
     388 | #define sk_v6_daddr             __sk_common.skc_v6_daddr
         |                                             ^~~~~~~~~~~~
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                             ^~~~
   net/mptcp/pm_netlink.c:2613:25: note: in expansion of macro 'if'
    2613 |                         if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
         |                         ^~
   net/mptcp/pm_netlink.c:2614:68: note: in expansion of macro 'sk_v6_daddr'
    2614 |                             !ipv6_addr_equal(&remote->addr6, &ssk->sk_v6_daddr))
         |                                                                    ^~~~~~~~~~~
>> net/mptcp/pm_netlink.c:2613:54: error: 'const struct mptcp_addr_info' has no member named 'addr6'; did you mean 'addr'?
    2613 |                         if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
         |                                                      ^~~~~
   include/linux/compiler.h:69:10: note: in definition of macro '__trace_if_value'
      69 |         (cond) ?                                        \
         |          ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
      56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
         |                            ^~~~~~~~~~~~~~
   net/mptcp/pm_netlink.c:2613:25: note: in expansion of macro 'if'
    2613 |                         if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
         |                         ^~
   net/mptcp/pm_netlink.c:2614:55: error: 'const struct mptcp_addr_info' has no member named 'addr6'; did you mean 'addr'?
    2614 |                             !ipv6_addr_equal(&remote->addr6, &ssk->sk_v6_daddr))
         |                                                       ^~~~~
   include/linux/compiler.h:69:10: note: in definition of macro '__trace_if_value'
      69 |         (cond) ?                                        \
         |          ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
      56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
         |                            ^~~~~~~~~~~~~~
   net/mptcp/pm_netlink.c:2613:25: note: in expansion of macro 'if'
    2613 |                         if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
         |                         ^~
>> include/net/sock.h:388:45: error: 'struct sock_common' has no member named 'skc_v6_daddr'; did you mean 'skc_daddr'?
     388 | #define sk_v6_daddr             __sk_common.skc_v6_daddr
         |                                             ^~~~~~~~~~~~
   include/linux/compiler.h:69:10: note: in definition of macro '__trace_if_value'
      69 |         (cond) ?                                        \
         |          ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
      56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
         |                            ^~~~~~~~~~~~~~
   net/mptcp/pm_netlink.c:2613:25: note: in expansion of macro 'if'
    2613 |                         if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
         |                         ^~
   net/mptcp/pm_netlink.c:2614:68: note: in expansion of macro 'sk_v6_daddr'
    2614 |                             !ipv6_addr_equal(&remote->addr6, &ssk->sk_v6_daddr))
         |                                                                    ^~~~~~~~~~~


vim +2613 net/mptcp/pm_netlink.c

  2579	
  2580	static struct sock *mptcp_nl_find_ssk(struct mptcp_sock *msk,
  2581					      const struct mptcp_addr_info *local,
  2582					      const struct mptcp_addr_info *remote)
  2583	{
  2584		struct sock *sk = &msk->sk.icsk_inet.sk;
  2585		struct mptcp_subflow_context *subflow;
  2586		struct sock *found = NULL;
  2587	
  2588		if (local->family != remote->family)
  2589			return NULL;
  2590	
  2591		lock_sock(sk);
  2592	
  2593		mptcp_for_each_subflow(msk, subflow) {
  2594			const struct ipv6_pinfo *pinfo;
  2595			const struct inet_sock *issk;
  2596			struct sock *ssk;
  2597	
  2598			ssk = mptcp_subflow_tcp_sock(subflow);
  2599	
  2600			if (local->family != ssk->sk_family)
  2601				continue;
  2602	
  2603			issk = inet_sk(ssk);
  2604	
  2605			switch (ssk->sk_family) {
  2606			case AF_INET:
  2607				if (issk->inet_saddr != local->addr.s_addr ||
  2608				    issk->inet_daddr != remote->addr.s_addr)
  2609					continue;
  2610				break;
  2611			case AF_INET6:
  2612				pinfo = inet6_sk(ssk);
> 2613				if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
  2614				    !ipv6_addr_equal(&remote->addr6, &ssk->sk_v6_daddr))
  2615					continue;
  2616				break;
  2617			default:
  2618				continue;
  2619			}
  2620	
  2621			if (issk->inet_sport == local->port &&
  2622			    issk->inet_dport == remote->port) {
  2623				found = ssk;
  2624				goto found;
  2625			}
  2626		}
  2627	
  2628	found:
  2629		release_sock(sk);
  2630	
  2631		return found;
  2632	}
  2633	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org