linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Cc: Petr Vorel <pvorel@suse.cz>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	Vlad Yasevich <vyasevich@gmail.com>,
	Cyril Hrubis <chrubis@suse.cz>,
	linux-sctp@vger.kernel.org
Subject: [PATCH 2/2] sctputil.h: TCONF on EAFNOSUPPORT
Date: Thu,  3 Feb 2022 18:05:22 +0100	[thread overview]
Message-ID: <20220203170522.22051-3-pvorel@suse.cz> (raw)
In-Reply-To: <20220203170522.22051-1-pvorel@suse.cz>

That's returned on systems without IPv6 support
(e.g. boot with ipv6.disable=1).

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 utils/sctp/testlib/sctputil.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/utils/sctp/testlib/sctputil.h b/utils/sctp/testlib/sctputil.h
index 1e21760bec..c4bedb47cf 100644
--- a/utils/sctp/testlib/sctputil.h
+++ b/utils/sctp/testlib/sctputil.h
@@ -133,9 +133,14 @@ extern int TST_CNT;
 static inline int test_socket(int domain, int type, int protocol)
 {
 	int sk = socket(domain, type, protocol);
+	int res = TBROK;
 
-	if (sk == -1)
-		tst_brkm(TBROK, tst_exit, "socket: %s", strerror(errno));
+	if (sk == -1) {
+		if (errno == EAFNOSUPPORT)
+			res = TCONF;
+
+		tst_brkm(res, tst_exit, "socket: %s", strerror(errno));
+	}
 
 	return sk;
 }
-- 
2.35.1


  parent reply	other threads:[~2022-02-03 17:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 17:05 [PATCH 0/2] Fix SCTP tests on systems with disabled IPv6 Petr Vorel
2022-02-03 17:05 ` [PATCH 1/2] sctputil.h: Fix some formatting Petr Vorel
2022-02-17  9:42   ` Cyril Hrubis
2022-02-17  9:45   ` Cyril Hrubis
2022-02-03 17:05 ` Petr Vorel [this message]
2022-02-17  9:56   ` [PATCH 2/2] sctputil.h: TCONF on EAFNOSUPPORT Cyril Hrubis
2022-02-17 11:45     ` Petr Vorel
2022-02-17 12:18     ` Petr Vorel

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=20220203170522.22051-3-pvorel@suse.cz \
    --to=pvorel@suse.cz \
    --cc=chrubis@suse.cz \
    --cc=linux-sctp@vger.kernel.org \
    --cc=ltp@lists.linux.it \
    --cc=marcelo.leitner@gmail.com \
    --cc=nhorman@tuxdriver.com \
    --cc=vyasevich@gmail.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;
as well as URLs for NNTP newsgroup(s).