Commit 3495e89c authored by Daniel Xu's avatar Daniel Xu Committed by Alexei Starovoitov
Browse files

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: default avatarDaniel Xu <dxu@dxuuu.xyz>
Link: https://lore.kernel.org/r/525c13d66dac2d640a1db922546842c051c6f2e6.1689970773.git.dxu@dxuuu.xyz


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 91721c2d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -301,6 +301,7 @@ int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts)
		       strlen(opts->cc) + 1))
		goto error_close;

	if (!opts->noconnect)
		if (connect_fd_to_addr(fd, &addr, addrlen, opts->must_fail))
			goto error_close;

+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ struct network_helper_opts {
	const char *cc;
	int timeout_ms;
	bool must_fail;
	bool noconnect;
};

/* ipv4 test vector */