From: David Hankins Date: Thu, 13 Dec 2007 16:50:17 +0000 (+0000) Subject: - The warning logged when an address range doesn't fit in the subnets X-Git-Tag: v4_1_0a1~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c12f7461b721bc82307a89dbd934b197426b87b;p=thirdparty%2Fdhcp.git - 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. [ISC-Bugs #17270] --- diff --git a/RELNOTES b/RELNOTES index 532987b66..cc1d47eab 100644 --- a/RELNOTES +++ b/RELNOTES @@ -53,6 +53,12 @@ may not work on other platforms. Please report any problems and suggested fixes to . + 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 diff --git a/server/mdb.c b/server/mdb.c index 2604117d2..74ab7789f 100644 --- a/server/mdb.c +++ b/server/mdb.c @@ -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... */