set INADDR_ANY/IN6ADDR_ANY_INIT address string to m_socket

when CUDPSocket::open() is called with m_address (in CUDPSocket) is nothing,
IPv4 socket is created by "0.0.0.0" (INADDR_ANY) address.

This causes a bug that DMRGateway cannot connect to reflector on IPv6.

Avoid this problem, set IP address string to m_socket (in CDMRNetwork) before
calling CUDPSocket::open().

This is a workaround, I think there is better idea.
This commit is contained in:
SASANO Takayoshi
2019-10-23 20:01:03 +09:00
parent 249bae1e7b
commit eb20786f36

View File

@@ -58,6 +58,8 @@ m_beacon(false)
assert(version != NULL);
CUDPSocket::lookup(address, port, m_address, m_addrlen);
CUDPSocket temp(m_address.ss_family == AF_INET ? "0.0.0.0" : "::", port);
m_socket = temp; // INADDR_ANY or IN6ADDR_ANY_INIT
m_buffer = new unsigned char[BUFFER_LENGTH];
m_salt = new unsigned char[sizeof(uint32_t)];