On 1/20/25 11:24, Stefano Garzarella wrote:
On Fri, Jan 17, 2025 at 10:59:45PM +0100, Michal Luczaj wrote:
quoted
+static void test_stream_connect_retry_client(const struct test_opts *opts)
+{
+ struct sockaddr_vm addr = {
+ .svm_family = AF_VSOCK,
+ .svm_cid = opts->peer_cid,
+ .svm_port = opts->peer_port
+ };
+ int s, alen = sizeof(addr);
+
+ s = socket(AF_VSOCK, SOCK_STREAM, 0);
+ if (s < 0) {
+ perror("socket");
+ exit(EXIT_FAILURE);
+ }
+
+ if (!connect(s, (struct sockaddr *)&addr, alen)) {
+ fprintf(stderr, "Unexpected connect() #1 success\n");
+ exit(EXIT_FAILURE);
+ }
+
+ control_writeln("LISTEN");
+ control_expectln("LISTENING");
+
+ if (connect(s, (struct sockaddr *)&addr, alen)) {
+ perror("connect() #2");
+ exit(EXIT_FAILURE);
+ }
What about using the timeout_begin()/timeout_end() we used in all other
places?
Oh, right!
Thanks for the review, all remaining comments addressed.