Netdev List
 help / color / mirror / Atom feed
From: Sebastian Chlad <sebastianchlad@gmail.com>
To: netdev@vger.kernel.org
Cc: Kuniyuki Iwashima <kuniyu@google.com>,
	Sebastian Chlad <sebastian.chlad@suse.com>
Subject: [PATCH net] selftests: af_unix: skip scm_inq tests when SO_INQ is unsupported
Date: Thu, 30 Jul 2026 16:46:52 +0200	[thread overview]
Message-ID: <20260730144652.5715-1-sebastian.chlad@suse.com> (raw)

SO_INQ was added in df30285b3670 ("af_unix: Introduce SO_INQ."). On
older kernels this returns -ENOPROTOOPT for SOCK_STREAM too, which
scm_inq.basic/partial_read currently treat as a failure.

Enabling SO_INQ here is only a precondition for the actual test: the
SCM_INQ/ioctl(SIOCINQ) consistency checks that follow. SKIP when the
precondition itself isn't met, rather than asserting it succeeds.

Signed-off-by: Sebastian Chlad <sebastian.chlad@suse.com>
---
 tools/testing/selftests/net/af_unix/scm_inq.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/testing/selftests/net/af_unix/scm_inq.c b/tools/testing/selftests/net/af_unix/scm_inq.c
index 6268b5bf50be..2868cce61a9a 100644
--- a/tools/testing/selftests/net/af_unix/scm_inq.c
+++ b/tools/testing/selftests/net/af_unix/scm_inq.c
@@ -111,6 +111,9 @@ TEST_F(scm_inq, basic)
 		return;
 	}
 
+	if (err && errno == ENOPROTOOPT)
+		SKIP(return, "SO_INQ is not supported");
+
 	ASSERT_EQ(0, err);
 
 	err = ioctl(self->fd[1], SIOCINQ, &inq);
@@ -136,6 +139,10 @@ TEST_F(scm_inq, partial_read)
 		ASSERT_EQ(-ENOPROTOOPT, -errno);
 		return;
 	}
+
+	if (err && errno == ENOPROTOOPT)
+		SKIP(return, "SO_INQ is not supported");
+
 	ASSERT_EQ(0, err);
 
 	ret = send(self->fd[0], buf, sizeof(buf), 0);
-- 
2.51.0


             reply	other threads:[~2026-07-30 14:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 14:46 Sebastian Chlad [this message]
2026-07-30 18:27 ` [PATCH net] selftests: af_unix: skip scm_inq tests when SO_INQ is unsupported Kuniyuki Iwashima
2026-07-31  5:41   ` Sebastian Chlad
2026-07-31  5:53     ` Kuniyuki Iwashima
2026-07-31  5:57       ` Sebastian Chlad
2026-08-31 15:57       ` Michal Koutný

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=20260730144652.5715-1-sebastian.chlad@suse.com \
    --to=sebastianchlad@gmail.com \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=sebastian.chlad@suse.com \
    /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