mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 08:16:59 +00:00
Fix to range dynamic-bootp specifier
Rely on inet_aton return value instead of some unreliable conversion result after first syscall failed. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
ff572a4a55
commit
e5020b723c
1 changed files with 2 additions and 4 deletions
|
|
@ -49,7 +49,6 @@ extern char *malloc();
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <limits.h>
|
|
||||||
|
|
||||||
#include "dhcpd-pools.h"
|
#include "dhcpd-pools.h"
|
||||||
#include "defaults.h"
|
#include "defaults.h"
|
||||||
|
|
@ -425,12 +424,11 @@ char *parse_config(int is_include, char *config_file,
|
||||||
case 3:
|
case 3:
|
||||||
/* printf ("range 1nd ip: %s\n", word); */
|
/* printf ("range 1nd ip: %s\n", word); */
|
||||||
range_p = ranges + num_ranges;
|
range_p = ranges + num_ranges;
|
||||||
inet_aton(word, &inp);
|
if (!(inet_aton(word, &inp))) {
|
||||||
range_p->first_ip = htonl(inp.s_addr) - 1;
|
|
||||||
if (range_p->first_ip == UINT_MAX) {
|
|
||||||
/* word was not ip, try again */
|
/* word was not ip, try again */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
range_p->first_ip = htonl(inp.s_addr) - 1;
|
||||||
argument = 2;
|
argument = 2;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue