From 4bb7e378ba6d2c825196f67fa9ae96a8a7584f78 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Tue, 18 Apr 2017 18:05:00 -0500 Subject: [PATCH] Connect to the network before doing a DNS lookup, if we're not connected already. --- atipmapping.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/atipmapping.c b/atipmapping.c index 58baf3c..55f850b 100644 --- a/atipmapping.c +++ b/atipmapping.c @@ -98,6 +98,10 @@ LongWord DoLookupName(NBPLookupNameRec *commandRec) { hostInfo.cvtPort = TCPIPMangleDomainName(0, &resultBuf->entityName.buffer[0]); } else { + // Make sure we're connected before doing DNS lookup. + if (TCPIPGetConnectStatus() == FALSE) + TCPIPConnect(NULL); + hostInfo.cvtPort = TCPIPMangleDomainName(0xE000, &resultBuf->entityName.buffer[0]); TCPIPDNRNameToIP(&resultBuf->entityName.buffer[0], &dnrInfo);