[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <caa2f86f-92a1-4b7b-b37c-bb8e4e0e3971@rbox.co>
Date: Tue, 21 Jan 2025 14:20:17 +0100
From: Michal Luczaj <mhal@...x.co>
To: Stefano Garzarella <sgarzare@...hat.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
George Zhang <georgezhang@...are.com>, Dmitry Torokhov <dtor@...are.com>,
Andy King <acking@...are.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net 5/5] vsock/test: Add test for connect() retries
On 1/20/25 11:24, Stefano Garzarella wrote:
> On Fri, Jan 17, 2025 at 10:59:45PM +0100, Michal Luczaj wrote:
>> +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.
Powered by blists - more mailing lists