You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Pass correct address size (ipv4,ipv6) to socket connect, bind, sendto
The address size passed to network system calls now reflects the the actual IP type (v4 or v6).
Fix Windows and OSX ipv6 sockets
(cherry picked from commit 80e911647c)
This commit is contained in:
@@ -87,11 +87,11 @@ Error TCPServerPosix::listen(uint16_t p_port, IP_Address::AddrType p_type, const
|
||||
}
|
||||
|
||||
struct sockaddr_storage addr;
|
||||
_set_listen_sockaddr(&addr, p_port, p_type, p_accepted_hosts);
|
||||
size_t addr_size = _set_listen_sockaddr(&addr, p_port, p_type, p_accepted_hosts);
|
||||
|
||||
// automatically fill with my IP TODO: use p_accepted_hosts
|
||||
|
||||
if (bind(sockfd, (struct sockaddr *)&addr, sizeof addr) != -1) {
|
||||
if (bind(sockfd, (struct sockaddr *)&addr, addr_size) != -1) {
|
||||
|
||||
if (::listen(sockfd, 1) == -1) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user