Ver código fonte

Abort immediately if no nameserver is present.

tags/v0.9.3
Michael Brown 19 anos atrás
pai
commit
0cfcd91558
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6
    0
      src/proto/dns.c

+ 6
- 0
src/proto/dns.c Ver arquivo

@@ -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 */

Carregando…
Cancelar
Salvar