From 0cfcd91558ef5c03326817e4a907f2e9c1c0c636 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 1 May 2005 13:59:34 +0000 Subject: [PATCH] Abort immediately if no nameserver is present. --- src/proto/dns.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/proto/dns.c b/src/proto/dns.c index b2f258bf..d74b29a9 100644 --- a/src/proto/dns.c +++ b/src/proto/dns.c @@ -249,6 +249,12 @@ static int dns_resolv ( struct in_addr *addr, const char *name ) { unsigned int recursion = 0; 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 ); /* Set up the query data */