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:
Sami Kerola 2011-01-22 12:06:34 +01:00
parent ff572a4a55
commit e5020b723c

View file

@ -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: