mptcpd icon indicating copy to clipboard operation
mptcpd copied to clipboard

Support listener events

Open matttbe opened this issue 1 year ago • 1 comments

These events have been added to the upstream kernel a while ago, see commit f8c9dfbd875b ("mptcp: add pm listener events") in the kernel.

To better explain why these events are useful, better to quote the feature request:

MPTCP for Linux, when not using the in-kernel PM, depends on the userspace PM to create extra listening sockets before announcing addresses and ports. Let's call these "PM listeners".

With the existing MPTCP netlink events, a userspace PM can create PM listeners at startup time, or in response to an incoming connection. Creating sockets in response to connections is not optimal: ADD_ADDRs can't be sent until the sockets are created and listen()ed, and if all connections are closed then it may not be clear to the userspace PM daemon that PM listener sockets should be cleaned up.

With the addition of MPTCP netlink events for listening socket close & create, PM listening sockets can be managed based on application activity.

These new events are then now handled by mptcpd, and plugins can be notified via two new hooks:

  • listener_created(laddr, pm)
  • listener_closed(laddr, pm)

Note that without this PR, many entries are visible in the logs mentioning these events are not supported each time a new listener socket is created (maybe it would be better to display this warning only once, but that's a different issue):

Unhandled MPTCP event: 15
Unhandled MPTCP event: 16

matttbe avatar Oct 07 '24 09:10 matttbe

Pull Request Test Coverage Report for Build 11252856342

Details

  • 10 of 40 (25.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.7%) to 64.075%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/path_manager.c 0 30 0.0%
<!-- Total: 10 40
Files with Coverage Reduction New Missed Lines %
src/path_manager.c 1 18.44%
<!-- Total: 1
Totals Coverage Status
Change from base Build 10861100461: -0.7%
Covered Lines: 1409
Relevant Lines: 2199

💛 - Coveralls

coveralls avatar Oct 08 '24 18:10 coveralls