ktls tests: Populate sockaddr fields before binding

Reported by:	Jenkins
Fixes:		b4b33821fa ("ktls: Fix interlocking between ktls_enable_rx() and listen(2)")
This commit is contained in:
Mark Johnston 2023-03-30 13:52:04 -04:00
parent fd02d0bc14
commit 5ea1e35d7d

View File

@ -2801,6 +2801,8 @@ ATF_TC_BODY(ktls_listening_socket, tc)
s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
ATF_REQUIRE(s >= 0);
memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
ATF_REQUIRE(bind(s, (struct sockaddr *)&sin, sizeof(sin)) == 0);
ATF_REQUIRE(listen(s, 1) == 0);
build_tls_enable(tc, CRYPTO_AES_NIST_GCM_16, 128 / 8, 0,