mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-18 00:37:01 +00:00
make range allocation dynamic
This is a test fix after commit
5cbe8d07fb
to see what can be done. Truth is that not much. I could fix how
ranges are allocated, but the fact there is pointers to shared
networks and network names reallocating the memory spaces is not
really going to work. The only way to truly fix this issue is to
create better data structures. As you can expect that is a major
change, and will take some time to implement.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
f6880ed5f4
commit
b492802dfa
6 changed files with 33 additions and 17 deletions
|
|
@ -26,7 +26,6 @@
|
|||
#include <err.h>
|
||||
|
||||
#include "dhcpd-pools.h"
|
||||
#include "defaults.h"
|
||||
|
||||
/* Sort functions for range sorting */
|
||||
int intcomp(const void *x, const void *y)
|
||||
|
|
@ -167,6 +166,8 @@ void mergesort_ranges(struct range_t *orig, int size, struct range_t *temp)
|
|||
{
|
||||
int left, right, i;
|
||||
struct range_t hold;
|
||||
/* Merge sort split size */
|
||||
static const int MIN_MERGE_SIZE = 8;
|
||||
|
||||
if (size < MIN_MERGE_SIZE) {
|
||||
for (left = 0; left < size; left++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue