selftest: af_unix: Make SCM_RIGHTS into OOB data.
scm_rights.c covers various test cases for inflight file descriptors and garbage collector for AF_UNIX sockets. Currently, SCM_RIGHTS messages are sent with 3-bytes string, and it's not good for MSG_OOB cases, as SCM_RIGTS cmsg goes with the first 2-bytes, which is non-OOB data. Let's send SCM_RIGHTS messages with 1-byte character to pack SCM_RIGHTS into OOB data. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: Michal Luczaj <mhal@rbox.co> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
041933a1ec
commit
e060e433e5
|
@ -197,8 +197,8 @@ void __send_fd(struct __test_metadata *_metadata,
|
||||||
const FIXTURE_VARIANT(scm_rights) *variant,
|
const FIXTURE_VARIANT(scm_rights) *variant,
|
||||||
int inflight, int receiver)
|
int inflight, int receiver)
|
||||||
{
|
{
|
||||||
#define MSG "nop"
|
#define MSG "x"
|
||||||
#define MSGLEN 3
|
#define MSGLEN 1
|
||||||
struct {
|
struct {
|
||||||
struct cmsghdr cmsghdr;
|
struct cmsghdr cmsghdr;
|
||||||
int fd[2];
|
int fd[2];
|
||||||
|
|
Loading…
Reference in New Issue