This series adds MSG_ERRQUEUE support on the MPTCP parent socket, so
poll() and recvmsg(MSG_ERRQUEUE) observe TX timestamps and MSG_ZEROCOPY
completion notifications through the standard inet ABI. IP_RECVERR /
IPV6_RECVERR (and their RFC4884 variants) are propagated to existing
and future subflows.
Patch 1 factors per-flag inet_assign_bit() calls in
sync_socket_options() into a mask-driven loop so future propagated
flags only need to extend MPTCP_INET_FLAGS_MASK.
Patch 2 wires up RECVERR setsockopt/getsockopt: snapshot the value,
apply it on the parent, and forward to every subflow under lock_sock()
so concurrent setsockopt callers cannot leave parent and subflows
desynchronized. Newly-joining subflows pick up the four RECVERR bits
through sync_socket_options().
Patch 3 splices forwardable err skbs (TIMESTAMPING / ZEROCOPY / LOCAL)
from each subflow's error queue onto the parent's, so pollers see
EPOLLERR and recvmsg(MSG_ERRQUEUE) on the parent drains them. Subflow
ICMP errors are dropped — they will be carried by a future
MPTCP_RECERR channel.
Patch 4 covers IP_RECVERR / IPV6_RECVERR propagation and the empty-
errqueue EAGAIN contract on MSG_ERRQUEUE | MSG_DONTWAIT in selftest.
v6 -> v7:
- patch 2: gate SOL_IPV6 setsockopt/getsockopt dispatch on
sk_family == AF_INET6, returning -ENOPROTOOPT otherwise, mirroring
plain TCP. Addresses the sashiko Medium finding on v6 where
IPV6_RECVERR silently succeeded on AF_INET MPTCP sockets.
- patch 3: track moved skbs in mptcp_recv_error() and retry
inet_recv_error() when ret == -EAGAIN && moved, so a successful
subflow splice is not masked by the initial drain returning EAGAIN
(sashiko High #2 on v6).
- patch 3: add mptcp_subflow_errqueue_pending() and OR it into the
EPOLLERR check in mptcp_poll(), so events stranded on a subflow
when the parent is under rmem pressure still wake userspace
(sashiko High #1 on v6).
- rebased on current export.
Tested with KVM-validation auto-normal: 25/25 pass.
David Carlier (4):
mptcp: sockopt: factor inet_flags propagation into a mask
mptcp: propagate RECVERR sockopts to subflows
mptcp: support MSG_ERRQUEUE on the parent socket
selftests: mptcp: cover IP_RECVERR sockopt propagation
net/mptcp/protocol.c | 92 ++++++++++-
net/mptcp/sockopt.c | 146 ++++++++++++++----
.../selftests/net/mptcp/mptcp_sockopt.c | 55 +++++++
3 files changed, 261 insertions(+), 32 deletions(-)
base-commit: 63b133728231ebba5167bd1e53dda9bcf0bee7c7
--
2.53.0