mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
getdata: fix consecutive range definition regression
The added test demonstrates the issue. If a did not end with whitespace it was skipped. Reported-by: Fredrik Lysén <fredrik.lysen@uadm.uu.se> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
48caf5fb42
commit
7fc354827a
7 changed files with 8 additions and 1 deletions
|
|
@ -263,6 +263,7 @@ if (posix_fadvise(fileno(dhcpd_config), 0, 0, POSIX_FADV_SEQUENTIAL) != 0) {
|
||||||
*
|
*
|
||||||
* ...to be interpreted correctly. */
|
* ...to be interpreted correctly. */
|
||||||
c = ' ';
|
c = ' ';
|
||||||
|
break;
|
||||||
} else if (argument == ITS_A_RANGE_SECOND_IP && i == 0) {
|
} else if (argument == ITS_A_RANGE_SECOND_IP && i == 0) {
|
||||||
range_p->last_ip = range_p->first_ip;
|
range_p->last_ip = range_p->first_ip;
|
||||||
goto newrange;
|
goto newrange;
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ TESTS = \
|
||||||
tests/full-json \
|
tests/full-json \
|
||||||
tests/leading0 \
|
tests/leading0 \
|
||||||
tests/one-ip \
|
tests/one-ip \
|
||||||
|
tests/one-line \
|
||||||
tests/same-twice \
|
tests/same-twice \
|
||||||
tests/simple \
|
tests/simple \
|
||||||
tests/v6
|
tests/v6
|
||||||
|
|
|
||||||
1
tests/confs/one-line
Normal file
1
tests/confs/one-line
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
pool {range 10.0.0.1 10.0.0.5;range 10.0.0.6 10.0.0.10;}
|
||||||
1
tests/expected/one-line
Symbolic link
1
tests/expected/one-line
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
simple
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
Ranges:
|
Ranges:
|
||||||
shared net name first ip last ip max cur percent touch t+c t+c perc
|
shared net name first ip last ip max cur percent touch t+c t+c perc
|
||||||
All networks 10.0.0.1 - 10.0.0.10 10 10 100.000 0 10 100.000
|
All networks 10.0.0.1 - 10.0.0.5 5 5 100.000 0 5 100.000
|
||||||
|
All networks 10.0.0.6 - 10.0.0.10 5 5 100.000 0 5 100.000
|
||||||
|
|
||||||
Shared networks:
|
Shared networks:
|
||||||
name max cur percent touch t+c t+c perc
|
name max cur percent touch t+c t+c perc
|
||||||
|
|
|
||||||
1
tests/leases/one-line
Symbolic link
1
tests/leases/one-line
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
simple
|
||||||
1
tests/one-line
Symbolic link
1
tests/one-line
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
test.sh
|
||||||
Loading…
Add table
Add a link
Reference in a new issue