Client options defined as (arrays of) integers are quoted for hosts (if hosts are defined in separated files), i.e.
dhcpd.conf contains:
...
option option-246 code 246 = string;
option tftp-server-address code 150 = array of ip-address;
option option-131 code 131 = { ip-address , unsigned integer 16 , unsigned integer 8 };
...
include "/etc/dhcp/host1.conf";
include "/etc/dhcp/host2.conf";
include "/etc/dhcp/host3.conf";
Example of host3.conf is:
host host_3 {
option option-131 "237.7.7.7 22222 10"; # <-- QUOTED (INCORRECT!)
option option-246 "some string";
fixed-address 192.168.1.103;
hardware ethernet xx:xx:xx:xx:xx;
}
Problem observed on Ubuntu 16.04 (x64) and isc-dhcp
I've checked and the fact that host is defined in separate file doesn't matter.
Have you tried to upgrading to Webmin 1.860? It should fix this.
Yes, and it didn't fix.
The issue still happens with version 1.953 on Ubuntu 16.04.4 with ISC DHCPd version 4.3.3
I am wondering about the existence of this bug, since it should have been fixed already in [#4664] from 2015 and in [#4777] later in 2016.
Steps to reproduce:
I manually define the following options in dhcpd.conf by directly editing the file:
and later
(values are changed for this bug report)
Subsequently, after viewing those options in Webmin under "Servers > DHCP Server > [a network range] > Edit Client Options", I can see those custom options and their arguments.
However, after pressing "Save", these arguments are enclosed by parentheses in the config file, as follows:
Finally, the DHCP service fails to start due to incorrect syntax: Number expected.
Note: Changing "integer" to "unsigned integer" makes no difference.
Related
Bugs:
#4664Bugs:
#4777Last edit: Robert Falkenberg 2020-07-15
Just re-tested this with Webmin 1.953, and was unable to reproduce the problem. Unless you're editing a value that is already quoted in dhcpd.conf, in which case Webmin will try to preserve it.
Hi,
thanks for the reply!
I'm on exactly the same version: 1.953. (Ubuntu Linux 16.04.4, Linux 4.4.0-174-generic on x86_64)
Did you check the newly written file "dhcpd.conf" after viewing the "Edit Client Options" and after pressing "Save"? (without changing any field)
Whether before of after pressing "save" - the textfield in Webmin's GUI always shows the values without quotation. However, the argument in the output file will be quoted after the first press of "save".
Just made some more tests and found something:
In my example, the part with
ist located in global scope within dhcpd.conf, while the second part is nested inside subscopes as follows:
If I move those routes up into the global scope, the output is correct and not quoted by the Webmin.
Is this behaviour intended?
Hello,
as I said in my last post, if I move the following options
into the global scope, Webmin handles the arguments correctly and performs no unintended quoting.
However, since my dhcpd.conf covers multiple subnets, I cannot simply define the static route in the global scope for all networks.
I also tried the opposite way and moved the part with
into the subnet definition. While this is also fine for Webmin (no unintended quoting), the ISC DHCP fails to start and complains about
So this is not an option.
Is there any possibility to teach Webmin to inherit these two global options to the nested scope of "shared-network" and "subnet" in order to provide a proper (unquoted) treatment of the numeric arguments?
Best Regards
Robert
Last edit: Robert Falkenberg 2020-08-18
That's surprising, because Webmin shouldn't treat option definitions any differently regardless of which scope their they are in.
Would it be possible to get a copy of your entire dhcpd.conf file? You can email it to jcameron@webmin.com
Thanks for the config - I think I see cause of this bug, and have checked in a fix at https://github.com/webmin/webmin/commit/677948bd9a20a316cc0abe456e147fb2719eb1eb