Browse Source

Abort immediately if no nameserver is present.

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
0cfcd91558
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/proto/dns.c

+ 6
- 0
src/proto/dns.c View File

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

Loading…
Cancel
Save