netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Luczaj <mhal@rbox.co>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, kuniyu@amazon.com, shuah@kernel.org
Subject: [PATCH net v2 2/2] selftest: af_unix: Make SCM_RIGHTS into OOB data.
Date: Thu, 16 May 2024 16:50:10 +0200	[thread overview]
Message-ID: <20240516145457.1206847-3-mhal@rbox.co> (raw)
In-Reply-To: <20240516145457.1206847-1-mhal@rbox.co>

From: Kuniyuki Iwashima <kuniyu@amazon.com>

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>
---
 tools/testing/selftests/net/af_unix/scm_rights.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/af_unix/scm_rights.c b/tools/testing/selftests/net/af_unix/scm_rights.c
index bab606c9f1eb..2bfed46e0b19 100644
--- a/tools/testing/selftests/net/af_unix/scm_rights.c
+++ b/tools/testing/selftests/net/af_unix/scm_rights.c
@@ -197,8 +197,8 @@ void __send_fd(struct __test_metadata *_metadata,
 	       const FIXTURE_VARIANT(scm_rights) *variant,
 	       int inflight, int receiver)
 {
-#define MSG "nop"
-#define MSGLEN 3
+#define MSG "x"
+#define MSGLEN 1
 	struct {
 		struct cmsghdr cmsghdr;
 		int fd[2];
-- 
2.45.0


      parent reply	other threads:[~2024-05-16 14:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-16 14:50 [PATCH net v2 0/2] af_unix: Fix GC and improve selftest Michal Luczaj
2024-05-16 14:50 ` [PATCH net v2 1/2] af_unix: Fix garbage collection of embryos carrying OOB with SCM_RIGHTS Michal Luczaj
2024-05-17  1:45   ` Kuniyuki Iwashima
2024-05-17  5:59     ` Michal Luczaj
2024-05-17  7:47       ` Kuniyuki Iwashima
2024-05-17  8:55         ` Michal Luczaj
2024-05-17  9:22           ` Kuniyuki Iwashima
2024-05-17  9:58             ` Michal Luczaj
2024-05-17 19:24         ` Jakub Kicinski
2024-05-19  8:47           ` Michal Luczaj
2024-05-16 14:50 ` Michal Luczaj [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240516145457.1206847-3-mhal@rbox.co \
    --to=mhal@rbox.co \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).