Skip to content

Commit

Permalink
mptcp: expose server_side attribute in MPTCP netlink events
Browse files Browse the repository at this point in the history
This change records the server_side attribute in MPTCP_EVENT_CREATED
and MPTCP_EVENT_ESTABLISHED events to inform the recipient of the role
of the associated MPTCP application (Client/Server) that is handling
it's end of the MPTCP connection.

Closes: multipath-tcp/mptcp_net-next#246
Signed-off-by: Kishen Maloor <kishen.maloor@intel.com>
  • Loading branch information
kmaloor authored and intel-lab-lkp committed Feb 3, 2022
1 parent d7b9ed3 commit 34d0832
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/uapi/linux/mptcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
3 changes: 3 additions & 0 deletions net/mptcp/pm_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2097,6 +2097,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);
}

Expand Down

0 comments on commit 34d0832

Please sign in to comment.