mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-04 00:25:29 +00:00
Use uv_os_sock_t instead of uv_os_fd_t for sockets
On POSIX based systems both uv_os_sock_t and uv_os_fd_t are both typedef to int. That's not true on Windows, where uv_os_sock_t is SOCKET and uv_os_fd_t is HANDLE and they differ in level of indirection.
This commit is contained in:
@@ -834,25 +834,25 @@ isc__nm_decstats(isc_nm_t *mgr, isc_statscounter_t counterid);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc__nm_socket_freebind(uv_os_fd_t fd, sa_family_t sa_family);
|
isc__nm_socket_freebind(uv_os_sock_t fd, sa_family_t sa_family);
|
||||||
/*%<
|
/*%<
|
||||||
* Set the IP_FREEBIND (or equivalent) socket option on the uv_handle
|
* Set the IP_FREEBIND (or equivalent) socket option on the uv_handle
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc__nm_socket_reuseport(uv_os_fd_t fd);
|
isc__nm_socket_reuseport(uv_os_sock_t fd);
|
||||||
/*%<
|
/*%<
|
||||||
* Set the SO_REUSEPORT (or equivalent) socket option on the fd
|
* Set the SO_REUSEPORT (or equivalent) socket option on the fd
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc__nm_socket_incoming_cpu(uv_os_fd_t fd);
|
isc__nm_socket_incoming_cpu(uv_os_sock_t fd);
|
||||||
/*%<
|
/*%<
|
||||||
* Set the SO_INCOMING_CPU socket option on the fd if available
|
* Set the SO_INCOMING_CPU socket option on the fd if available
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc__nm_socket_dontfrag(uv_os_fd_t fd, sa_family_t sa_family);
|
isc__nm_socket_dontfrag(uv_os_sock_t fd, sa_family_t sa_family);
|
||||||
/*%<
|
/*%<
|
||||||
* Set the SO_IP_DONTFRAG (or equivalent) socket option of the fd if available
|
* Set the SO_IP_DONTFRAG (or equivalent) socket option of the fd if available
|
||||||
*/
|
*/
|
||||||
|
@@ -1584,7 +1584,7 @@ isc__nm_decstats(isc_nm_t *mgr, isc_statscounter_t counterid) {
|
|||||||
setsockopt(socket, level, name, &(int){ 1 }, sizeof(int))
|
setsockopt(socket, level, name, &(int){ 1 }, sizeof(int))
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc__nm_socket_freebind(uv_os_fd_t fd, sa_family_t sa_family) {
|
isc__nm_socket_freebind(uv_os_sock_t fd, sa_family_t sa_family) {
|
||||||
/*
|
/*
|
||||||
* Set the IP_FREEBIND (or equivalent option) on the uv_handle.
|
* Set the IP_FREEBIND (or equivalent option) on the uv_handle.
|
||||||
*/
|
*/
|
||||||
@@ -1625,7 +1625,7 @@ isc__nm_socket_freebind(uv_os_fd_t fd, sa_family_t sa_family) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc__nm_socket_reuseport(uv_os_fd_t fd) {
|
isc__nm_socket_reuseport(uv_os_sock_t fd) {
|
||||||
/*
|
/*
|
||||||
* This is SO_REUSE**** hell:
|
* This is SO_REUSE**** hell:
|
||||||
*
|
*
|
||||||
@@ -1668,7 +1668,7 @@ isc__nm_socket_reuseport(uv_os_fd_t fd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc__nm_socket_incoming_cpu(uv_os_fd_t fd) {
|
isc__nm_socket_incoming_cpu(uv_os_sock_t fd) {
|
||||||
#ifdef SO_INCOMING_CPU
|
#ifdef SO_INCOMING_CPU
|
||||||
if (setsockopt_on(fd, SOL_SOCKET, SO_INCOMING_CPU) == -1) {
|
if (setsockopt_on(fd, SOL_SOCKET, SO_INCOMING_CPU) == -1) {
|
||||||
return (ISC_R_FAILURE);
|
return (ISC_R_FAILURE);
|
||||||
@@ -1682,7 +1682,7 @@ isc__nm_socket_incoming_cpu(uv_os_fd_t fd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc__nm_socket_dontfrag(uv_os_fd_t fd, sa_family_t sa_family) {
|
isc__nm_socket_dontfrag(uv_os_sock_t fd, sa_family_t sa_family) {
|
||||||
/*
|
/*
|
||||||
* Set the Don't Fragment flag on IP packets
|
* Set the Don't Fragment flag on IP packets
|
||||||
*/
|
*/
|
||||||
|
@@ -319,7 +319,7 @@ isc__nm_async_tcplisten(isc__networker_t *worker, isc__netievent_t *ev0) {
|
|||||||
struct sockaddr_storage sname;
|
struct sockaddr_storage sname;
|
||||||
int r, flags = 0, snamelen = sizeof(sname);
|
int r, flags = 0, snamelen = sizeof(sname);
|
||||||
sa_family_t sa_family;
|
sa_family_t sa_family;
|
||||||
uv_os_fd_t fd;
|
uv_os_sock_t fd;
|
||||||
|
|
||||||
REQUIRE(isc__nm_in_netthread());
|
REQUIRE(isc__nm_in_netthread());
|
||||||
REQUIRE(sock->type == isc_nm_tcplistener);
|
REQUIRE(sock->type == isc_nm_tcplistener);
|
||||||
@@ -344,7 +344,7 @@ isc__nm_async_tcplisten(isc__networker_t *worker, isc__netievent_t *ev0) {
|
|||||||
r = uv_tcp_bind(&sock->uv_handle.tcp, &sock->iface->addr.type.sa,
|
r = uv_tcp_bind(&sock->uv_handle.tcp, &sock->iface->addr.type.sa,
|
||||||
flags);
|
flags);
|
||||||
if (r == UV_EADDRNOTAVAIL &&
|
if (r == UV_EADDRNOTAVAIL &&
|
||||||
uv_fileno(&sock->uv_handle.handle, &fd) == 0 &&
|
uv_fileno(&sock->uv_handle.handle, (uv_os_fd_t *)&fd) == 0 &&
|
||||||
isc__nm_socket_freebind(fd, sa_family) == ISC_R_SUCCESS)
|
isc__nm_socket_freebind(fd, sa_family) == ISC_R_SUCCESS)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user