mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-22 09:57:20 +00:00
Don't look up null zones, and don't allocate a zone if we already have one.
This commit is contained in:
parent
b5f904a9a3
commit
488e1310f6
10
common/dns.c
10
common/dns.c
@ -42,7 +42,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: dns.c,v 1.30 2000/11/02 00:04:40 neild Exp $ Copyright (c) 2000 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: dns.c,v 1.31 2000/11/24 03:55:46 mellon Exp $ Copyright (c) 2000 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
@ -305,6 +305,10 @@ ns_rcode find_cached_zone (const char *dname, ns_class class,
|
||||
if (!zcookie)
|
||||
return ns_r_servfail;
|
||||
|
||||
/* We can't look up a null zone. */
|
||||
if (!dname || !*dname)
|
||||
return ns_r_servfail;
|
||||
|
||||
/* For each subzone, try to find a cached zone. */
|
||||
for (np = dname - 1; np; np = strchr (np, '.')) {
|
||||
np++;
|
||||
@ -418,9 +422,7 @@ void cache_found_zone (ns_class class,
|
||||
option_cache_dereference (&zone -> primary, MDL);
|
||||
if (zone -> secondary)
|
||||
option_cache_dereference (&zone -> secondary, MDL);
|
||||
}
|
||||
|
||||
if (!dns_zone_allocate (&zone, MDL))
|
||||
} else if (!dns_zone_allocate (&zone, MDL))
|
||||
return;
|
||||
|
||||
if (!zone -> name) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user