mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
bpf: selftests: Support not connecting client socket
For connectionless protocols or raw sockets we do not want to actually connect() to the server. Signed-off-by: Daniel Xu <dxu@dxuuu.xyz> Link: https://lore.kernel.org/r/525c13d66dac2d640a1db922546842c051c6f2e6.1689970773.git.dxu@dxuuu.xyz Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
91721c2d02
commit
3495e89cdc
|
|
@ -301,8 +301,9 @@ int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts)
|
|||
strlen(opts->cc) + 1))
|
||||
goto error_close;
|
||||
|
||||
if (connect_fd_to_addr(fd, &addr, addrlen, opts->must_fail))
|
||||
goto error_close;
|
||||
if (!opts->noconnect)
|
||||
if (connect_fd_to_addr(fd, &addr, addrlen, opts->must_fail))
|
||||
goto error_close;
|
||||
|
||||
return fd;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ struct network_helper_opts {
|
|||
const char *cc;
|
||||
int timeout_ms;
|
||||
bool must_fail;
|
||||
bool noconnect;
|
||||
};
|
||||
|
||||
/* ipv4 test vector */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user