From e5020b723c8184f0ecd58a45fb21795f1e655854 Mon Sep 17 00:00:00 2001
From: Sami Kerola <kerolasa@iki.fi>
Date: Sat, 22 Jan 2011 12:06:34 +0100
Subject: [PATCH] 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>
---
 src/getdata.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

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 <fcntl.h>
 #include <errno.h>
 #include <ctype.h>
-#include <limits.h>
 
 #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:
-- 
1.7.10.4