[LTP] [PATCH 1/1] lib/safe_net: TCONF SAFE_LISTEN() on ENOSYS

Petr Vorel pvorel@suse.cz
Fri Dec 10 15:35:36 CET 2021


This is needed at least on bind04 on SLES with Common Criteria setup,
which is more strict and thus does not allow md5 usage:

bind04.c:138: TBROK: listen(3, 1) failed: ENOSYS (38)
sctp: failed to load transform for md5: -2

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/safe_net.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/safe_net.c b/lib/safe_net.c
index 211fd9b67d..1717f0745f 100644
--- a/lib/safe_net.c
+++ b/lib/safe_net.c
@@ -368,11 +368,14 @@ int safe_listen(const char *file, const int lineno, void (cleanup_fn)(void),
 		int socket, int backlog)
 {
 	int rval;
+	int res = TBROK;
 
 	rval = listen(socket, backlog);
 
 	if (rval == -1) {
-		tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn,
+		if (errno == ENOSYS)
+			res = TCONF;
+		tst_brkm_(file, lineno, res | TERRNO, cleanup_fn,
 			"listen(%d, %d) failed", socket, backlog);
 	} else if (rval) {
 		tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn,
-- 
2.34.1



More information about the ltp mailing list