]> git.pld-linux.org Git - packages/dhcp.git/blob - dhcp-confparse.patch
- updated to 4.4.3, more patches from Fedora
[packages/dhcp.git] / dhcp-confparse.patch
1 From bdbbb4be07bb33fe083baef2bd0ef38b91c11120 Mon Sep 17 00:00:00 2001
2 From: Pavel Zhukov <pzhukov@redhat.com>
3 Date: Thu, 21 Feb 2019 10:44:06 +0100
4 Subject: [PATCH 21/28] Load leases DB in non-replay mode only
5
6 ---
7  server/confpars.c | 12 ++++++++++--
8  1 file changed, 10 insertions(+), 2 deletions(-)
9
10 diff --git a/server/confpars.c b/server/confpars.c
11 index 5a6396b..6e08ad7 100644
12 --- a/server/confpars.c
13 +++ b/server/confpars.c
14 @@ -134,6 +134,11 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
15  
16         cfile = (struct parse *)0;
17  #if defined (TRACING)
18 +       // No need to dmalloc huge memory region if we're not going to re-play
19 +       if (!trace_record()){
20 +               status = new_parse(&cfile, file, NULL, 0, filename, 0);
21 +               goto noreplay;
22 +       };
23         flen = lseek (file, (off_t)0, SEEK_END);
24         if (flen < 0) {
25               boom:
26 @@ -165,7 +170,6 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
27         if (result != ulen)
28                 log_fatal ("%s: short read of %d bytes instead of %d.",
29                            filename, ulen, result);
30 -       close (file);
31        memfile:
32         /* If we're recording, write out the filename and file contents. */
33         if (trace_record ())
34 @@ -174,6 +178,9 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
35  #else
36         status = new_parse(&cfile, file, NULL, 0, filename, 0);
37  #endif
38 +      noreplay:
39 +       if (!trace_playback())
40 +               close (file);
41         if (status != ISC_R_SUCCESS || cfile == NULL)
42                 return status;
43  
44 @@ -183,7 +190,8 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
45                 status = conf_file_subparse (cfile, group, group_type);
46         end_parse (&cfile);
47  #if defined (TRACING)
48 -       dfree (dbuf, MDL);
49 +       if (trace_record())
50 +           dfree (dbuf, MDL);
51  #endif
52         return status;
53  }
54 -- 
55 2.35.1
56
This page took 0.044134 seconds and 3 git commands to generate.