mirror of
https://github.com/systemd/systemd
synced 2024-10-04 23:31:09 +00:00
fuzz: set SOCK_CLOEXEC and SOCK_NONBLOCK
This commit is contained in:
parent
c0e3d79970
commit
804a6a1759
|
@ -18,7 +18,7 @@ int dhcp6_network_send_udp_socket(int s, struct in6_addr *server_address,
|
|||
}
|
||||
|
||||
int dhcp6_network_bind_udp_socket(int index, struct in6_addr *local_address) {
|
||||
assert_se(socketpair(AF_UNIX, SOCK_STREAM, 0, test_dhcp_fd) >= 0);
|
||||
assert_se(socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, test_dhcp_fd) >= 0);
|
||||
return test_dhcp_fd[0];
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
static int test_fd[2] = { -1, -1 };
|
||||
|
||||
int lldp_network_bind_raw_socket(int ifindex) {
|
||||
if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0, test_fd) < 0)
|
||||
if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, test_fd) < 0)
|
||||
return -errno;
|
||||
|
||||
return test_fd[0];
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
static int test_fd[2];
|
||||
|
||||
int icmp6_bind_router_solicitation(int index) {
|
||||
assert_se(socketpair(AF_UNIX, SOCK_STREAM, 0, test_fd) >= 0);
|
||||
assert_se(socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, test_fd) >= 0);
|
||||
return test_fd[0];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue