]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- The warning logged when an address range doesn't fit in the subnets
authorDavid Hankins <dhankins@isc.org>
Thu, 13 Dec 2007 16:50:17 +0000 (16:50 +0000)
committerDavid Hankins <dhankins@isc.org>
Thu, 13 Dec 2007 16:50:17 +0000 (16:50 +0000)
  they were declared has been updated to be more helpful and identify the
  typo in configuration that created the spanning addresses.
  [ISC-Bugs #17270]

RELNOTES
server/mdb.c

index 532987b6683e17d482be0249806745078b539c4e..cc1d47eabd4c874279ec2dba98da6b2a898faacc 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -53,6 +53,12 @@ may not work on other platforms. Please report any problems and
 suggested fixes to <dhcp-users@isc.org>.
 
 
+                       Chagnes since 4.0.0
+
+- The warning logged when an address range doesn't fit in the subnets
+  they were declared has been updated to be more helpful and identify the
+  typo in configuration that created the spanning addresses.
+
                        Changes since 4.0.0b3
 
 - The reverse dns name for PTR updates on IPv6 addresses has been fixed to
index 2604117d263d95950444f3be8165b86c9938d887..74ab7789fc98b78b362e2a162860dbf4ce00fc49 100644 (file)
@@ -715,7 +715,6 @@ void new_address_range (cfile, low, high, subnet, pool, lpchain)
        struct lease **lpchain;
 {
        struct lease *address_range;
-       struct iaddr net;
        unsigned min, max, i;
        char lowbuf [16], highbuf [16], netbuf [16];
        struct shared_network *share = subnet -> shared_network;
@@ -747,23 +746,19 @@ void new_address_range (cfile, low, high, subnet, pool, lpchain)
                        log_fatal ("Can't allocate lease/hw hash");
        }
 
-       /* Make sure that high and low addresses are in same subnet. */
-       net = subnet_number (low, subnet -> netmask);
-       if (!addr_eq (net, subnet_number (high, subnet -> netmask))) {
-               strcpy (lowbuf, piaddr (low));
-               strcpy (highbuf, piaddr (high));
-               strcpy (netbuf, piaddr (subnet -> netmask));
-               log_fatal ("Address range %s to %s, netmask %s spans %s!",
-                      lowbuf, highbuf, netbuf, "multiple subnets");
+       /* Make sure that high and low addresses are in this subnet. */
+       if (!addr_eq(subnet->net, subnet_number(low, subnet->netmask))) {
+               strcpy(lowbuf, piaddr(low));
+               strcpy(netbuf, piaddr(subnet->net));
+               log_fatal("bad range, address %s not in subnet %s netmask %s",
+                         lowbuf, netbuf, piaddr(subnet->netmask));
        }
 
-       /* Make sure that the addresses are on the correct subnet. */
-       if (!addr_eq (net, subnet -> net)) {
-               strcpy (lowbuf, piaddr (low));
-               strcpy (highbuf, piaddr (high));
-               strcpy (netbuf, piaddr (subnet -> netmask));
-               log_fatal ("Address range %s to %s not on net %s/%s!",
-                      lowbuf, highbuf, piaddr (subnet -> net), netbuf);
+       if (!addr_eq(subnet->net, subnet_number(high, subnet->netmask))) {
+               strcpy(highbuf, piaddr(high));
+               strcpy(netbuf, piaddr(subnet->net));
+               log_fatal("bad range, address %s not in subnet %s netmask %s",
+                         highbuf, netbuf, piaddr(subnet->netmask));
        }
 
        /* Get the high and low host addresses... */