Abort immediately if no nameserver is present.

pull/1/head
Michael Brown 2005-05-01 13:59:34 +00:00
parent bcedad4708
commit 0cfcd91558
1 changed files with 6 additions and 0 deletions

View File

@ -249,6 +249,12 @@ static int dns_resolv ( struct in_addr *addr, const char *name ) {
unsigned int recursion = 0; unsigned int recursion = 0;
unsigned int id = 1; unsigned int id = 1;
/* Fail immediately if we have no name server */
if ( ! arptable[ARP_NAMESERVER].ipaddr.s_addr ) {
DBG ( "DNS has no nameserver\n" );
return 0;
}
DBG ( "DNS resolving %s\n", name ); DBG ( "DNS resolving %s\n", name );
/* Set up the query data */ /* Set up the query data */