From 385d099a8b7d939b5ca6c82c9ad0cafd5aed7dc3 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Sat, 4 Feb 2017 19:03:13 -0800 Subject: [PATCH] - added some network debug output when network debug enabled for NIC's examined on network hosting (for Issue #137) --- source/shared_lib/sources/platform/posix/socket.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index bc6dda040..8dcc51647 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -738,6 +738,9 @@ std::vector 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);