cg3protocol: disable G3 support automatically when no IPv4 address provided

pull/189/head
SASANO Takayoshi 5 years ago
parent fbc012f04c
commit c3ea3b48cb

@ -49,11 +49,21 @@ bool CG3Protocol::Init(void)
// base class
ok = CProtocol::Init();
#ifdef DEBUG_NO_G3_SUPPORT
// G3 support can be killed (currently for test purpose)
// G3 needs IPv4 address
bool ipv4 = false;
#if !defined(DEBUG_NO_G3_SUPPORT)
for ( int i = 0; i < UDP_SOCKET_MAX; i++ )
{
CIp ip = g_Reflector.GetListenIp(i);
socklen_t ss_len;
ipv4 |= ( ip.GetSockAddr(ss_len)->ss_family == AF_INET );
}
#endif
if ( !ipv4 ) {
std::cout << "No IPv4 address, G3 support is disabled" << std::endl;
m_bStopThread = true;
return true;
#endif
}
// update reflector callsign
m_ReflectorCallsign.PatchCallsign(0, (const uint8 *)"XLX", 3);

Loading…
Cancel
Save

Powered by TurnKey Linux.