Skip to content

Commit

Permalink
Customize hosted socket factory to set SO_MARK
Browse files Browse the repository at this point in the history
Implements setting the SO_MARK option for sockets designated for the `hosted` services.

Signed-off-by: Tom Carroll <[email protected]>
  • Loading branch information
tomc797 committed Oct 24, 2024
1 parent 4284925 commit 3d2db66
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions programs/ziti-edge-tunnel/netif_driver/linux/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,3 +649,25 @@ uv_os_sock_t tlsuv_socket(const struct addrinfo *ai, bool blocking)

return sd;
}

/**
* Override ziti_hosting_cbs socket factory. This factory is used to create
* the sockets used for `hosted` services.
*/
int
ziti_tunnel_hosting_socket(uv_os_sock_t *psock, const struct addrinfo *ai)
{
uv_os_sock_t sd;

sd = make_bypass_socket(ai, true);
if (sd < 0) {
int uv_err = uv_translate_sys_error(errno);

*psock = -1;
return uv_err;
}

*psock = sd;

return 0;
}

0 comments on commit 3d2db66

Please sign in to comment.