git.asbjorn.biz
/
debian
/
dhcpd-pools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
getdata: increase max number of shared networks
[debian/dhcpd-pools.git]
/
src
/
getdata.c
diff --git
a/src/getdata.c
b/src/getdata.c
index
fe513ae
..
c57d2c7
100644
(file)
--- a/
src/getdata.c
+++ b/
src/getdata.c
@@
-60,10
+60,10
@@
extern char *malloc();
int parse_leases(void)
{
FILE *dhcpd_leases;
int parse_leases(void)
{
FILE *dhcpd_leases;
- char *line, *ipstring, *macstring;
+ char *line, *ipstring, *macstring = NULL;
struct in_addr inp;
struct stat lease_file_stats;
struct in_addr inp;
struct stat lease_file_stats;
- struct macaddr_t *macaddr_p;
+ struct macaddr_t *macaddr_p = NULL;
unsigned long leasesmallocsize;
unsigned long touchesmallocsize;
unsigned long backupsmallocsize;
unsigned long leasesmallocsize;
unsigned long touchesmallocsize;
unsigned long backupsmallocsize;
@@
-163,6
+163,7
@@
int parse_leases(void)
if (macaddr != NULL) {
free(macstring);
}
if (macaddr != NULL) {
free(macstring);
}
+ fclose(dhcpd_leases);
return 0;
}
return 0;
}
@@
-387,7
+388,7
@@
char *parse_config(int is_include, char *config_file,
num_ranges++;
if (RANGES < num_ranges) {
errx(EXIT_FAILURE,
num_ranges++;
if (RANGES < num_ranges) {
errx(EXIT_FAILURE,
- "parse_config: Range space full! Increase RANGES and recompile.");
+ "parse_config: increase default.h RANGES and recompile.");
}
newclause = true;
break;
}
newclause = true;
break;
@@
-426,8
+427,15
@@
char *parse_config(int is_include, char *config_file,
* away by reallocationg
* more space. */
errx(EXIT_FAILURE,
* away by reallocationg
* more space. */
errx(EXIT_FAILURE,
- "parse_config: End of shared-network space, increase SHARED_NETWORKS_NAMES and recompile");
+ "parse_config: increase default.h SHARED_NETWORKS_NAMES and recompile");
}
}
+ if (SHARED_NETWORKS < num_shared_networks) {
+ /* FIXME: make this go
+ * away by reallocationg
+ * more space. */
+ errx(EXIT_FAILURE,
+ "parse_config: increase default.h SHARED_NETWORKS and recompile");
+ }
argument = 0;
braces_shared = braces;
break;
argument = 0;
braces_shared = braces;
break;
@@
-452,5
+460,6
@@
char *parse_config(int is_include, char *config_file,
}
}
free(word);
}
}
free(word);
+ fclose(dhcpd_config);
return next_free_shared_name;
}
return next_free_shared_name;
}