浏览代码

Abort immediately if no nameserver is present.

tags/v0.9.3
Michael Brown 19 年前
父节点
当前提交
0cfcd91558
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6
    0
      src/proto/dns.c

+ 6
- 0
src/proto/dns.c 查看文件

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

正在加载...
取消
保存