From: Sami Kerola Date: Sat, 22 Jan 2011 11:06:34 +0000 (+0100) Subject: Fix to range dynamic-bootp specifier X-Git-Tag: v2.14~18 X-Git-Url: http://git.asbjorn.it/?p=debian%2Fdhcpd-pools.git;a=commitdiff_plain;h=e5020b723c8184f0ecd58a45fb21795f1e655854 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 --- diff --git a/src/getdata.c b/src/getdata.c index ae3bc38..0356649 100644 --- a/src/getdata.c +++ b/src/getdata.c @@ -49,7 +49,6 @@ extern char *malloc(); #include #include #include -#include #include "dhcpd-pools.h" #include "defaults.h" @@ -425,12 +424,11 @@ char *parse_config(int is_include, char *config_file, case 3: /* printf ("range 1nd ip: %s\n", word); */ range_p = ranges + num_ranges; - inet_aton(word, &inp); - range_p->first_ip = htonl(inp.s_addr) - 1; - if (range_p->first_ip == UINT_MAX) { + if (!(inet_aton(word, &inp))) { /* word was not ip, try again */ break; } + range_p->first_ip = htonl(inp.s_addr) - 1; argument = 2; break; case 4: