From e2de752020ea51428bbaaa7358f08632c42aa89d Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Thu, 21 Feb 2019 10:44:06 +0100 Subject: [PATCH 21/26] Load leases DB in non-replay mode only Cc: pzhukov@redhat.com --- server/confpars.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/confpars.c b/server/confpars.c index 2743979..db21a0b 100644 --- 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: @@ -171,9 +176,11 @@ isc_result_t read_conf_file (const char *filename, struct group *group, 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 + 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, else status = conf_file_subparse (cfile, group, group_type); end_parse (&cfile); -#if defined (TRACING) - dfree (dbuf, MDL); -#endif return status; } -- 2.14.5