summaryrefslogtreecommitdiff
path: root/drivers/unix/net_socket_posix.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-11-18 15:15:24 +0100
committerGitHub <noreply@github.com>2018-11-18 15:15:24 +0100
commit4a050568a28898a45cebe350f31bb2af867b32ff (patch)
tree3e2f09978d4cdaa452f355b9206f6c6b2de8733c /drivers/unix/net_socket_posix.cpp
parent35b421b6954c5baff4b4fd4bc56b09c85dae6ff5 (diff)
parent1ef9e9ef6abc8070f5259f11a79c352580e45049 (diff)
Merge pull request #23798 from Faless/socket_ipv4_wildcard_fix
Properly accept wildcard when binding IPv4 socket.
Diffstat (limited to 'drivers/unix/net_socket_posix.cpp')
-rw-r--r--drivers/unix/net_socket_posix.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp
index f981be66ce..833b17f122 100644
--- a/drivers/unix/net_socket_posix.cpp
+++ b/drivers/unix/net_socket_posix.cpp
@@ -110,7 +110,7 @@ size_t NetSocketPosix::_set_addr_storage(struct sockaddr_storage *p_addr, const
} else { // IPv4 socket
// IPv4 socket with IPv6 address
- ERR_FAIL_COND_V(!p_ip.is_ipv4(), 0);
+ ERR_FAIL_COND_V(!p_ip.is_wildcard() && !p_ip.is_ipv4(), 0);
struct sockaddr_in *addr4 = (struct sockaddr_in *)p_addr;
addr4->sin_family = AF_INET;
@@ -122,7 +122,6 @@ size_t NetSocketPosix::_set_addr_storage(struct sockaddr_storage *p_addr, const
addr4->sin_addr.s_addr = INADDR_ANY;
}
- copymem(&addr4->sin_addr.s_addr, p_ip.get_ipv4(), 4);
return sizeof(sockaddr_in);
}
}