Design for sendmsg/recvmsg #985
Replies: 2 comments 10 replies
-
So, the main issue here is that, as we don't create a socket in the agent when the layer does a Your design looks good to me, we're going to end up with something like the agent's Some general ideas, but again, what you have looks like it would work just fine.
You mean create an
This one is starting to tell us that maybe it would be nice to start mimicking libc calls more, I mean, when a user calls But you can get away right now with just creating a new socket in the agent when
How are you going to deal with non-blocking sockets? If you use the "send This depends on how reliable we want to have this be (and also means we need to handle I would go for your proposal, of using |
Beta Was this translation helpful? Give feedback.
-
Here's my proposal (which builds on top of the great research and great suggestions):
|
Beta Was this translation helpful? Give feedback.
-
Through this discussion, I propose adding hooks for
sendmsg
andrecvmsg
system calls.The main reason why we need to hook these system calls is because of the use case highlighted in #969. The error encountered looked like so:
And on further exploration it was found that
sendmsg
was called, which we don't hook.https://github.com/apple-open-source/macos/blob/2494a13fb49fdc15996d7297069bf84d42b30d3c/bind9/bind9/lib/isc/unix/net.c#L575
In terms of the design of how two hooks should be implemented, I have the following suggestion:
Considerations
consider the case of a udp client:
the address is provided to the msg_name is sendmsg but when recvmsg is called, it is implicitly bound to the address on which sendmsg was called.
Here messages are received only on the bound address, providing any address to
cli_addr
does not make a difference and is ignored.It seems that the address is filled by the call, as can be seen by adding the following line
Design
sendmsg
DISCUSS
: how to keep some kind of mapping must be maintained between the layer and the agent for these sockets just like how we do for filesrecvmsg
Im maintaining a miro design diagram for this, ill post a design once there is final verdict on design from this
Beta Was this translation helpful? Give feedback.
All reactions