- added some network debug output when network debug enabled for NIC's examined on network hosting (for Issue #137)

This commit is contained in:
SoftCoder 2017-02-04 19:03:13 -08:00
parent 644c76e0c1
commit 385d099a8b
1 changed files with 3 additions and 0 deletions

View File

@ -738,6 +738,9 @@ std::vector<std::string> Socket::getLocalIPAddressList() {
/* I want IP address attached to "eth0" */
char szBuf[100]="";
snprintf(szBuf,100,"%s%d",intfName.c_str(),idx);
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] Trying NIC named [%s]\n",__FILE__,__FUNCTION__,__LINE__,szBuf);
//printf("In [%s::%s Line: %d] Trying NIC named [%s]\n",__FILE__,__FUNCTION__,__LINE__,szBuf);
int maxIfNameLength = std::min((int)strlen(szBuf),IFNAMSIZ-1);
strncpy(ifr.ifr_name, szBuf, maxIfNameLength);