fuzz: set SOCK_CLOEXEC and SOCK_NONBLOCK

This commit is contained in:
Yu Watanabe 2018-11-12 01:57:27 +09:00
parent c0e3d79970
commit 804a6a1759
3 changed files with 3 additions and 3 deletions

View file

@ -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];
}

View file

@ -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];

View file

@ -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];
}