2019-10-22 14:58:01 +00:00
|
|
|
From e2de752020ea51428bbaaa7358f08632c42aa89d Mon Sep 17 00:00:00 2001
|
2019-03-01 11:50:13 +00:00
|
|
|
From: Pavel Zhukov <pzhukov@redhat.com>
|
|
|
|
Date: Thu, 21 Feb 2019 10:44:06 +0100
|
2019-10-22 14:58:01 +00:00
|
|
|
Subject: [PATCH 21/26] Load leases DB in non-replay mode only
|
2019-03-01 11:50:13 +00:00
|
|
|
Cc: pzhukov@redhat.com
|
|
|
|
|
|
|
|
---
|
|
|
|
server/confpars.c | 10 +++++++---
|
|
|
|
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
|
|
|
2018-09-24 13:01:32 +00:00
|
|
|
diff --git a/server/confpars.c b/server/confpars.c
|
2019-03-01 11:50:13 +00:00
|
|
|
index 2743979..db21a0b 100644
|
2018-09-24 13:01:32 +00:00
|
|
|
--- a/server/confpars.c
|
|
|
|
+++ b/server/confpars.c
|
|
|
|
@@ -134,6 +134,11 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
|
|
|
|
|
|
|
|
cfile = (struct parse *)0;
|
|
|
|
#if defined (TRACING)
|
|
|
|
+ // No need to dmalloc huge memory region if we're not going to re-play
|
|
|
|
+ if (!trace_playback()){
|
|
|
|
+ status = new_parse(&cfile, file, NULL, 0, filename, 0);
|
|
|
|
+ goto noreplay;
|
|
|
|
+ };
|
|
|
|
flen = lseek (file, (off_t)0, SEEK_END);
|
|
|
|
if (flen < 0) {
|
|
|
|
boom:
|
2019-03-01 11:50:13 +00:00
|
|
|
@@ -171,9 +176,11 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
|
2018-09-24 13:01:32 +00:00
|
|
|
if (trace_record ())
|
|
|
|
trace_write_packet (ttype, ulen + tflen + 1, dbuf, MDL);
|
|
|
|
status = new_parse(&cfile, -1, fbuf, ulen, filename, 0); /* XXX */
|
|
|
|
+ dfree(dbuf, MDL);
|
|
|
|
#else
|
|
|
|
status = new_parse(&cfile, file, NULL, 0, filename, 0);
|
|
|
|
#endif
|
2019-03-01 11:50:13 +00:00
|
|
|
+ noreplay:
|
|
|
|
if (status != ISC_R_SUCCESS || cfile == NULL)
|
|
|
|
return status;
|
|
|
|
|
|
|
|
@@ -182,9 +189,6 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
|
2018-09-24 13:01:32 +00:00
|
|
|
else
|
|
|
|
status = conf_file_subparse (cfile, group, group_type);
|
|
|
|
end_parse (&cfile);
|
|
|
|
-#if defined (TRACING)
|
|
|
|
- dfree (dbuf, MDL);
|
|
|
|
-#endif
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2019-03-01 11:50:13 +00:00
|
|
|
--
|
|
|
|
2.14.5
|
|
|
|
|