Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions include/mptcpd/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ typedef uint32_t mptcpd_flags_t;
*/
#define MPTCPD_ADDR_FLAG_FULLMESH (1U << 3)

/**
* @brief Endpoint implicitly created by the kernel PM.
*
* It exists because no userspace ones correspond to the associated address
* and port. It can only be set by the kernel.
*
* @note Do not set from the userspace to the kernelspace.
*/
#define MPTCPD_ADDR_FLAG_IMPLICIT (1U << 4)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks. Then I wonder whether it's possible to somehow protect this define against using it in the userspace... (except from moving it into the comment block, which would also prevent it from using in the kernelspace too).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's needed:

  • if set, the kernel will reject it anyway. No need to prevent it from mptcpd I think if plugins devs cannot read the doc :)
  • this define is only linked to the in-kernel PM, probably not so many plugins will look at controlling it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair then! :)


/// Use this endpoint in reaction to ADD_ADDR, but only once.
#define MPTCPD_ADDR_FLAG_LAMINAR (1U << 5)
///@}
Expand Down
1 change: 1 addition & 0 deletions src/netlink_pm_upstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
|| MPTCPD_ADDR_FLAG_SUBFLOW != MPTCP_PM_ADDR_FLAG_SUBFLOW \
|| MPTCPD_ADDR_FLAG_BACKUP != MPTCP_PM_ADDR_FLAG_BACKUP \
|| MPTCPD_ADDR_FLAG_FULLMESH != MPTCP_PM_ADDR_FLAG_FULLMESH \
|| MPTCPD_ADDR_FLAG_IMPLICIT != MPTCP_PM_ADDR_FLAG_IMPLICIT \
|| MPTCPD_ADDR_FLAG_LAMINAR != MPTCP_PM_ADDR_FLAG_LAMINAR
# error Mismatch between mptcpd and upstream kernel addr flags.
#endif
Expand Down