Hello friends, I managed to compile the tfs with a code of auto global ip, everything worked normal it takes the ip of good, the problem is that instead he picked up my Default Gateway is the IP of the Internet, it is grabbing the computer IP.
code:
how can i fixed it? thanks.
code:
Code:
if( g_config.getString(ConfigManager::IP) == "auto" )
{
char szHostName[128];
if( gethostname( szHostName , 128) == 0 )
{
struct hostent* he = gethostbyname( szHostName );
if( he != NULL )
{
ip = inet_ntoa( * ( reinterpret_cast< in_addr* >( he->h_addr )));
}
}
}
else{
ip = g_config.getString(ConfigManager::IP);
}
Last edited: