[LTP] [PATCH v2 5/5] setsockopt0[38]: Use tst_is_compat_mode()

Petr Vorel pvorel@suse.cz
Tue May 21 12:53:48 CEST 2024


Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
New in v2

I wonder if both shouldn't be TCONF or TINFO.

Kind regards,
Petr

 testcases/kernel/syscalls/setsockopt/setsockopt03.c | 5 ++---
 testcases/kernel/syscalls/setsockopt/setsockopt08.c | 6 ++----
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt03.c b/testcases/kernel/syscalls/setsockopt/setsockopt03.c
index 7a1458277..d910280c8 100644
--- a/testcases/kernel/syscalls/setsockopt/setsockopt03.c
+++ b/testcases/kernel/syscalls/setsockopt/setsockopt03.c
@@ -48,9 +48,8 @@ struct payload {
 
 static void setup(void)
 {
-	if (tst_kernel_bits() == 32 || sizeof(long) > 4)
-		tst_res(TCONF,
-			"The vulnerability was only present in 32-bit compat mode");
+	if (!tst_is_compat_mode())
+		tst_res(TCONF, "The vulnerability was only present in 32-bit compat mode");
 }
 
 static void run(void)
diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt08.c b/testcases/kernel/syscalls/setsockopt/setsockopt08.c
index 7f8243de1..3b7bd8482 100644
--- a/testcases/kernel/syscalls/setsockopt/setsockopt08.c
+++ b/testcases/kernel/syscalls/setsockopt/setsockopt08.c
@@ -95,10 +95,8 @@ static void *buffer;
 
 void setup(void)
 {
-	if (tst_kernel_bits() == 32 || sizeof(long) > 4) {
-		tst_res(TINFO,
-			"The vulnerability was only present in 32-bit compat mode");
-	}
+	if (!tst_is_compat_mode())
+		tst_res(TINFO, "The vulnerability was only present in 32-bit compat mode");
 
 	tst_setup_netns();
 }
-- 
2.43.0



More information about the ltp mailing list