mirror of
https://github.com/g4klx/DMRGateway
synced 2025-12-22 22:45:36 +08:00
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:
@@ -58,6 +58,8 @@ m_beacon(false)
|
|||||||
assert(version != NULL);
|
assert(version != NULL);
|
||||||
|
|
||||||
CUDPSocket::lookup(address, port, m_address, m_addrlen);
|
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_buffer = new unsigned char[BUFFER_LENGTH];
|
||||||
m_salt = new unsigned char[sizeof(uint32_t)];
|
m_salt = new unsigned char[sizeof(uint32_t)];
|
||||||
|
|||||||
Reference in New Issue
Block a user