Skip to content
Commit 26162cac authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Pavel Emelyanov
Browse files

pie: Optimize send_fds() and recv_fds() with opts



Do not ask kernel to transfer more opts than we really need.

When we're sending fds with flags, we ask kernel to copy the whole
struct scm_fdset::opts array, like we'd send CR_SCM_MAX_FD fds,
even if really we're transmitting only one fd.
send_fds() does not initializes the rest of array memory, but kernel
transmits this garbage. Also, recv_msg() does not return it to userspace.

This patch makes kernel do not transmit uninitialized garbage.

travis-ci: success for pie: Optimize send_fds() and recv_fds() with opts
Signed-off-by: default avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: default avatarPavel Emelyanov <xemul@virtuozzo.com>
parent d0263ab8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment