mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 23:45:49 +08:00
Merge branch 'ipv6' into SimpleDMR
This commit is contained in:
@@ -321,8 +321,8 @@ int CMMDVMHost::run()
|
||||
return 1;
|
||||
}
|
||||
|
||||
in_addr transparentAddress;
|
||||
unsigned int transparentPort = 0U;
|
||||
sockaddr_storage transparentAddress;
|
||||
unsigned int transparentAddrLen;
|
||||
CUDPSocket* transparentSocket = NULL;
|
||||
|
||||
unsigned int sendFrameType = 0U;
|
||||
@@ -338,11 +338,10 @@ int CMMDVMHost::run()
|
||||
LogInfo(" Local Port: %u", localPort);
|
||||
LogInfo(" Send Frame Type: %u", sendFrameType);
|
||||
|
||||
transparentAddress = CUDPSocket::lookup(remoteAddress);
|
||||
transparentPort = remotePort;
|
||||
CUDPSocket::lookup(remoteAddress, remotePort, transparentAddress, transparentAddrLen);
|
||||
|
||||
transparentSocket = new CUDPSocket(localPort);
|
||||
ret = transparentSocket->open();
|
||||
ret = transparentSocket->open(transparentAddress.ss_family);
|
||||
if (!ret) {
|
||||
LogWarning("Could not open the Transparent data socket, disabling");
|
||||
delete transparentSocket;
|
||||
@@ -611,12 +610,14 @@ int CMMDVMHost::run()
|
||||
|
||||
bool remoteControlEnabled = m_conf.getRemoteControlEnabled();
|
||||
if (remoteControlEnabled) {
|
||||
std::string address = m_conf.getRemoteControlAddress();
|
||||
unsigned int port = m_conf.getRemoteControlPort();
|
||||
|
||||
LogInfo("Remote Control Parameters");
|
||||
LogInfo(" Address: %s", address.c_str());
|
||||
LogInfo(" Port: %u", port);
|
||||
|
||||
m_remoteControl = new CRemoteControl(port);
|
||||
m_remoteControl = new CRemoteControl(address, port);
|
||||
|
||||
ret = m_remoteControl->open();
|
||||
if (!ret) {
|
||||
@@ -803,7 +804,7 @@ int CMMDVMHost::run()
|
||||
|
||||
len = m_modem->readTransparentData(data);
|
||||
if (transparentSocket != NULL && len > 0U)
|
||||
transparentSocket->write(data, len, transparentAddress, transparentPort);
|
||||
transparentSocket->write(data, len, transparentAddress, transparentAddrLen);
|
||||
|
||||
if (!m_fixedMode) {
|
||||
if (m_modeTimer.isRunning() && m_modeTimer.hasExpired())
|
||||
@@ -952,9 +953,9 @@ int CMMDVMHost::run()
|
||||
}
|
||||
|
||||
if (transparentSocket != NULL) {
|
||||
in_addr address;
|
||||
unsigned int port = 0U;
|
||||
len = transparentSocket->read(data, 200U, address, port);
|
||||
sockaddr_storage address;
|
||||
unsigned int addrlen;
|
||||
len = transparentSocket->read(data, 200U, address, addrlen);
|
||||
if (len > 0U)
|
||||
m_modem->writeTransparentData(data, len);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user