From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: netdev@vger.kernel.org
Cc: Kishen Maloor <kishen.maloor@intel.com>,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
matthieu.baerts@tessares.net, mptcp@lists.linux.dev,
Mat Martineau <mathew.j.martineau@linux.intel.com>
Subject: [PATCH net-next 6/7] mptcp: expose server_side attribute in MPTCP netlink events
Date: Mon, 2 May 2022 13:52:36 -0700 [thread overview]
Message-ID: <20220502205237.129297-7-mathew.j.martineau@linux.intel.com> (raw)
In-Reply-To: <20220502205237.129297-1-mathew.j.martineau@linux.intel.com>
From: Kishen Maloor <kishen.maloor@intel.com>
This change records the 'server_side' attribute of MPTCP_EVENT_CREATED
and MPTCP_EVENT_ESTABLISHED events to inform their recipient about the
Client/Server role of the running MPTCP application.
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/246
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Kishen Maloor <kishen.maloor@intel.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
---
include/uapi/linux/mptcp.h | 1 +
net/mptcp/pm_netlink.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
index 9690efedb5fa..e41ea01a94bb 100644
--- a/include/uapi/linux/mptcp.h
+++ b/include/uapi/linux/mptcp.h
@@ -188,6 +188,7 @@ enum mptcp_event_attr {
MPTCP_ATTR_IF_IDX, /* s32 */
MPTCP_ATTR_RESET_REASON,/* u32 */
MPTCP_ATTR_RESET_FLAGS, /* u32 */
+ MPTCP_ATTR_SERVER_SIDE, /* u8 */
__MPTCP_ATTR_AFTER_LAST
};
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index eeaa96bcae6c..a4430c576ce9 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1985,6 +1985,9 @@ static int mptcp_event_created(struct sk_buff *skb,
if (err)
return err;
+ if (nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, READ_ONCE(msk->pm.server_side)))
+ return -EMSGSIZE;
+
return mptcp_event_add_subflow(skb, ssk);
}
--
2.36.0
next prev parent reply other threads:[~2022-05-02 20:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-02 20:52 [PATCH net-next 0/7] mptcp: Userspace path manager prerequisites Mat Martineau
2022-05-02 20:52 ` [PATCH net-next 1/7] mptcp: bypass in-kernel PM restrictions for non-kernel PMs Mat Martineau
2022-05-02 20:52 ` [PATCH net-next 2/7] selftests: mptcp: ADD_ADDR echo test with missing userspace daemon Mat Martineau
2022-05-02 20:52 ` [PATCH net-next 3/7] mptcp: store remote id from MP_JOIN SYN/ACK in local ctx Mat Martineau
2022-05-02 20:52 ` [PATCH net-next 4/7] mptcp: reflect remote port (not 0) in ANNOUNCED events Mat Martineau
2022-05-02 20:52 ` [PATCH net-next 5/7] mptcp: establish subflows from either end of connection Mat Martineau
2022-05-02 20:52 ` Mat Martineau [this message]
2022-05-02 20:52 ` [PATCH net-next 7/7] mptcp: allow ADD_ADDR reissuance by userspace PMs Mat Martineau
2022-05-04 0:00 ` [PATCH net-next 0/7] mptcp: Userspace path manager prerequisites patchwork-bot+netdevbpf
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=20220502205237.129297-7-mathew.j.martineau@linux.intel.com \
--to=mathew.j.martineau@linux.intel.com \
--cc=davem@davemloft.net \
--cc=kishen.maloor@intel.com \
--cc=kuba@kernel.org \
--cc=matthieu.baerts@tessares.net \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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