Skip to content
Snippets Groups Projects
Commit b296a4a4 authored by rswindell's avatar rswindell
Browse files

Changed algorithm for detect IP address vs host name (now supports hostnames...

Changed algorithm for detect IP address vs host name (now supports hostnames starting with a digit).
parent 14a28565
No related branches found
No related tags found
No related merge requests found
......@@ -481,9 +481,14 @@ static void sockmsgtxt(SOCKET socket, smbmsg_t* msg, char* msgtxt, char* fromadd
static u_long resolve_ip(char *addr)
{
HOSTENT* host;
char* p;
if(isdigit(addr[0]) && strchr(addr,'.'))
for(p=addr;*p;p++)
if(*p!='.' && !isdigit(*p))
break;
if(!(*p))
return(inet_addr(addr));
if ((host=gethostbyname(addr))==NULL) {
lprintf("0000 !ERROR resolving host name: %s",addr);
return(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment