setsockopt(TCP_ULP) now fails on a socket in a sockmap. Check that
instead of setsockopt(TLS_TX).
Suggested-by: Alexei Starovoitov <a…@kernel.org>
Signed-off-by: Sechang Lim <rhkr…@gmail.com>
---
.../selftests/bpf/prog_tests/sockmap_ktls.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c b/tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c
index 34737e8df6ea..749b41b743df 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c
@@ -118,12 +118,6 @@ static void test_sockmap_ktls_update_fails_when_sock_has_ulp(int family, int map
static void test_sockmap_ktls_enable_fails_when_in_sockmap(int family, int map)
{
- struct tls12_crypto_info_aes_gcm_128 crypto = {
- .info = {
- .version = TLS_1_2_VERSION,
- .cipher_type = TLS_CIPHER_AES_GCM_128,
- },
- };
struct sockaddr_storage addr = {};
socklen_t len = sizeof(addr);
struct sockaddr_in6 *v6;
@@ -165,14 +159,8 @@ static void test_sockmap_ktls_enable_fails_when_in_sockmap(int family, int map)
if (!ASSERT_OK(err, "sockmap update elem"))
goto close;
- /* Installing the TLS ULP is allowed, it does not touch the datapath. */
err = setsockopt(s, IPPROTO_TCP, TCP_ULP, "tls", strlen("tls"));
- if (!ASSERT_OK(err, "setsockopt(TCP_ULP)"))
- goto close;
-
- /* Enabling the TLS crypto datapath must be rejected. */
- err = setsockopt(s, SOL_TLS, TLS_TX, &crypto, sizeof(crypto));
- ASSERT_ERR(err, "setsockopt(TLS_TX)");
+ ASSERT_ERR(err, "setsockopt(TCP_ULP)");
close:
close(s);
--
2.56.1