jhthorsen/net-isc-dhcpd

Unable to parse a config with "authoritative" within subnet statements

Closed this issue · 1 comments

When using "authoritative" statements within subnet declarations the parser bails out with:
Could not parse " authoritative;" at test.authoritative-subnet.conf line 17

According to the man-page:
"Usually, writing authoritative; at the top level of the file should be sufficient. However, if a DHCP server is to be set up so that it is aware of some networks for which it is authoritative and some networks for which it is not, it may be more appropriate to declare authority on a per-network-segment basis."

test.authoritative-subnet.conf:
default-lease-time 3600;
max-lease-time 3600;
option domain-name "foobar.com";
option domain-name-servers 10.0.0.11, 10.0.0.12;
option time-servers 10.0.0.13,10.0.0.14;
option ntp-servers 10.0.0.20,10.0.0.14;

deny client-updates;
log-facility local6;
omapi-port 7911;

set vendorclass = option vendor-class-identifier;

ddns-update-style none; ddns-updates off;

subnet 10.1.10.0 netmask 255.255.255.0 {
authoritative;
option broadcast-address 10.1.10.255;
option routers 10.1.10.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.1.10.11, 10.1.10.12;
if substring (option vendor-class-identifier,0,9) = "PXEClient" {
filename "pxelinux.0";
}
host testhost01 {hardware ethernet 00:01:02:03:04:01;fixed-address 10.1.10.21;}
host testhost02 {hardware ethernet 00:01:02:03:04:02;fixed-address 10.1.10.22;}
}

subnet 10.2.10.0 netmask 255.255.255.0 {
option broadcast-address 10.2.10.255;
option routers 10.2.10.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.1.10.11, 10.1.10.12;
if substring (option vendor-class-identifier,0,9) = "PXEClient" {
filename "pxelinux.0";
}
host testhost03 {hardware ethernet 00:01:02:03:04:03;fixed-address 10.2.10.21;}
host testhost04 {hardware ethernet 00:01:02:03:04:04;fixed-address 10.2.10.22;}
}

I've merged the patch. I'm not going to do a new release just yet because I've got a couple of other bugs I wanted to take a look at. Thanks for the updates.