e83fb19
diff -up dhcp-4.3.0a1/server/confpars.c.range6 dhcp-4.3.0a1/server/confpars.c
e83fb19
--- dhcp-4.3.0a1/server/confpars.c.range6	2013-12-20 13:53:44.899161427 +0100
e83fb19
+++ dhcp-4.3.0a1/server/confpars.c	2013-12-20 13:56:31.595835977 +0100
e83fb19
@@ -3925,6 +3925,18 @@ add_ipv6_pond_to_network(struct group *g
e83fb19
 	return;
67cff45
 }
67cff45
 
67cff45
+static void
67cff45
+check_addr_in_subnet(struct subnet *subnet, struct iaddr *addr) {
67cff45
+	char lowbuf [INET6_ADDRSTRLEN], netbuf [INET6_ADDRSTRLEN];
67cff45
+
67cff45
+	if (!addr_eq(subnet->net, subnet_number(*addr, subnet->netmask))) {
077cc76
+		strncpy(lowbuf, piaddr(*addr), INET6_ADDRSTRLEN);
077cc76
+		strncpy(netbuf, piaddr(subnet->net), INET6_ADDRSTRLEN);
67cff45
+		log_fatal("bad range6, address %s not in subnet6 %s/%d",
67cff45
+			lowbuf, netbuf, subnet->prefix_len);
67cff45
+	}
67cff45
+
67cff45
+}
e83fb19
 
67cff45
 /* address-range6-declaration :== ip-address6 ip-address6 SEMI
67cff45
 			       | ip-address6 SLASH number SEMI
e83fb19
@@ -3967,6 +3979,8 @@ parse_address_range6(struct parse *cfile
e83fb19
 	memset(&net, 0, sizeof(net));
e83fb19
 	net.cidrnet.lo_addr = lo;
67cff45
 
67cff45
+	check_addr_in_subnet(group->subnet, &lo);
67cff45
+
67cff45
 	/* 
67cff45
 	 * See if we we're using range or CIDR notation or TEMPORARY
67cff45
 	 */
e83fb19
@@ -4036,6 +4050,8 @@ parse_address_range6(struct parse *cfile
67cff45
 			return;
67cff45
 		}
67cff45
 
67cff45
+		check_addr_in_subnet(group->subnet, &hi;;
67cff45
+
67cff45
 		/*
67cff45
 		 * Convert our range to a set of CIDR networks.
67cff45
 		 */