summaryrefslogtreecommitdiff
path: root/eth-multiplexer
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2021-05-26 15:36:28 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-08-10 22:11:38 +0200
commit7360a092712ad01c5803901df5ca6e0edef4150f (patch)
treebb0b78b99b867a239bf8e53dac74d3cae4ee41df /eth-multiplexer
parent9393fb33d0405cfb99449241139413f0aae6f4f0 (diff)
Do not use ports_get_right () for send-one rights
ports_get_right () expects the caller to make a send, not a send-once, right from the returned receive right, and increments the expected make-send count accordingly. The kernel, however, does not increment the make-send count when a send-once right is being made. The result can be described as a "no-senders leak": libports' idea of the current make-send count always stays one step ahead of it actual value (or several steps ahead, if the process is repeated), which makes libports ignore *all* the subsequent no-senders notifications for the port as outdated.
Diffstat (limited to 'eth-multiplexer')
-rw-r--r--eth-multiplexer/device_impl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/eth-multiplexer/device_impl.c b/eth-multiplexer/device_impl.c
index a6e6f59c..74f78f22 100644
--- a/eth-multiplexer/device_impl.c
+++ b/eth-multiplexer/device_impl.c
@@ -189,7 +189,7 @@ ds_device_set_filter (struct vether_device *vdev, mach_port_t receive_port,
return D_NO_SUCH_DEVICE;
err = mach_port_request_notification (mach_task_self (), receive_port,
MACH_NOTIFY_DEAD_NAME, 0,
- ports_get_right (notify_pi),
+ notify_pi->port_right,
MACH_MSG_TYPE_MAKE_SEND_ONCE, &tmp);
if (err != KERN_SUCCESS)
goto out;