@@ -296,7 +296,7 @@ static int connect_fd_to_addr(int fd,
return -1;
}
} else {
- if (ret) {
+ if (ret && errno != expect_errno) {
log_err("Failed to connect to server");
return -1;
}
@@ -10,6 +10,7 @@ static void run_lookup_test(__u16 *g_serv_port, int out_sk)
{
struct network_helper_opts opts = {
.timeout_ms = 1000,
+ .expect_errno = EINPROGRESS,
};
int serv_sk = -1, in_sk = -1, serv_in_sk = -1, err;
struct sockaddr_in6 addr = {};
@@ -28,7 +29,7 @@ static void run_lookup_test(__u16 *g_serv_port, int out_sk)
/* Client outside of test cgroup should fail to connect by timeout. */
err = connect_fd_to_fd(out_sk, serv_sk, &opts);
- if (CHECK(!err || errno != EINPROGRESS, "connect_fd_to_fd",
+ if (CHECK(err || errno != EINPROGRESS, "connect_fd_to_fd",
"unexpected result err %d errno %d\n", err, errno))
goto cleanup;