fuzz: set SOCK_CLOEXEC and SOCK_NONBLOCK
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user