-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null bytes in protobuf messages sent via unix datagram socket #2
Comments
Hi! Ey, good catch! Thanks a lot for your brilliant assessment and proposals to improve the IPC interface! I would +1 the D-BUS choice. Some comments below.
Schönes Wochenende! |
There was a C-based example in samples/bpf/xdpsock_ctrl_proc.c and xdpsock_user.c in kernels prior to 6.0 (I removed it in that release). Do not know if that will help you. If you are looking for a higher level example, maybe @garylough has something? |
Thanks a lot for providing these details! |
Do not keep the connection to detd open. This fixes two issues: - In case detd restarts, the connection got dropped - Due to Avnu/detd#2, the connection is in an invalid state after a ok = False was sent Since the requests are comparatively rare, there is no advantage of keeping the connection open. Signed-off-by: Florian Kauer <[email protected]> Reviewed-by: Kurt Kanzenbach <[email protected]>
Hi,
I just noticed that when the service sends a StreamQosResponse with
ok = False
, an empty packet is received on receiver side.The reason for that is that protobuf messages are allowed to contain null bytes (and a False boolean is encoded as null byte
\0
).Unfortunately, that is also the terminator of a datagram. In the current implementation that probably got unnoticed, because if
ok = False
the subsequent fields are ignored anyway. However, I still think we should avoid sending raw protobuf messages via unix datagram sockets.I am happy to provide a fix, but since there are many different options to solve this, I would appreciate your opinion on this topic:
What do you think?
The text was updated successfully, but these errors were encountered: