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