Changes since 4.0.0
+- Exit with warning when DHCPv6-specific statements are used in the
+ config file but -6 is not specified.
+
- It's now possible to update the "ends" field of a lease with OMAPI.
This is useful if you want not only to release a lease, but also make
it available for reuse right away. Hat tip to Christof Chen.
char v6[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
int v6_len;
+ if (local_family != AF_INET6) {
+ parse_warn(cfile, "IPv6 addresses are only available "
+ "in DHCPv6 mode.");
+ skip_to_semi(cfile);
+ return 0;
+ }
+
/*
* First token is non-raw. This way we eat any whitespace before
* our IPv6 address begins, like one would expect.
0xF0, 0xF8, 0xFC, 0xFE };
struct iaddr iaddr;
+ if (local_family != AF_INET6) {
+ parse_warn(cfile, "subnet6 statement is only supported "
+ "in DHCPv6 mode.");
+ skip_to_semi(cfile);
+ return;
+ }
+
subnet = NULL;
status = subnet_allocate(&subnet, MDL);
if (status != ISC_R_SUCCESS) {
struct iaddrcidrnetlist *nets;
struct iaddrcidrnetlist *p;
+ if (local_family != AF_INET6) {
+ parse_warn(cfile, "range6 statement is only supported "
+ "in DHCPv6 mode.");
+ skip_to_semi(cfile);
+ return;
+ }
+
/*
* We'll use the shared_network from our group.
*/
struct binding *bnd;
struct binding_value *nv=NULL;
+ if (local_family != AF_INET6) {
+ parse_warn(cfile, "IA_NA is only supported in DHCPv6 mode.");
+ skip_to_semi(cfile);
+ return;
+ }
+
token = next_token(&val, &len, cfile);
if (token != STRING) {
parse_warn(cfile, "corrupt lease file; "
struct binding *bnd;
struct binding_value *nv=NULL;
+ if (local_family != AF_INET6) {
+ parse_warn(cfile, "IA_TA is only supported in DHCPv6 mode.");
+ skip_to_semi(cfile);
+ return;
+ }
+
token = next_token(&val, &len, cfile);
if (token != STRING) {
parse_warn(cfile, "corrupt lease file; "
struct binding *bnd;
struct binding_value *nv=NULL;
+ if (local_family != AF_INET6) {
+ parse_warn(cfile, "IA_PD is only supported in DHCPv6 mode.");
+ skip_to_semi(cfile);
+ return;
+ }
+
token = next_token(&val, &len, cfile);
if (token != STRING) {
parse_warn(cfile, "corrupt lease file; "