Menu

#4777 Custom DHCP option: array treated as string and quoted

1.801
closed-fixed
nobody
dhcp server (2)
5
2016-06-19
2016-06-16
No

I have a very similar problem to that described in ticket [#4644]. I have the following custom option definitions in /etc/dhcp/dhcpd.conf:

option ms-classless-static-routes code 249 = array of integer 8;
option rfc3442-classless-static-routes code 121 = array of integer 8;

and when I edit the values of these options in webmin, they end up double-quoted in /etc/dhcp/dhcp.conf and the DHCP server fails to restart unless I edit dhcpd.conf by hand and remove the double-quotes again. I am using webmin version 1.801, so if I am reading the comments for ticket [#4644] correctly this should have been fixed.

The main difference with the scenario described in ticket [#4644] is that I am using these options in a group rather than for an individual host:

subnet 192.168.131.0 netmask 255.255.255.0 {
    option routers 192.168.131.1;
    ....
    group {
                    use-host-decl-names on;
                option ms-classless-static-routes 0 , 192 , 168 , 131 , 1 , 24 , 192 , 168 , 130 , 192 , 168 , 131 , 3;
                option rfc3442-classless-static-routes 0 , 192 , 168 , 131 , 1 , 24 , 192 , 168 , 130 , 192 , 168 , 131 , 3;

Other info: webmin is running on CentOS 6.7, and I am using Firefox 47.0 to access it.

Related

Bugs: #4644
Bugs: #5028

Discussion

  • Peter Keller

    Peter Keller - 2016-06-16

    Sorry: I got the reference to the related bug wrong. It is in fact [#4664], but it looks like I can't edit my original report.

     

    Related

    Bugs: #4664


    Last edit: Peter Keller 2016-06-16
  • Jamie Cameron

    Jamie Cameron - 2016-06-17

    I'm confused, because in https://sourceforge.net/p/webadmin/bugs/4664/ the poster said that for "array of integer" options, they were required to be a quoted list of comma-separated numbers. But you're saying that they should not be quoted?

     
  • Peter Keller

    Peter Keller - 2016-06-17

    I found the bug report [#4664] rather hard to follow, however I read it as saying that the example configuration that the OP posted was the one that produced the error:

    /etc/dhcp/dhcpd.conf line 202: expecting number.
    option rfc3442-classless-static-routes "24 , 106 , 31 , 64 , 10 , 0 , 0 , 3"
    ^
    /etc/dhcp/dhcpd.conf line 203: expecting number.
    option ms-classless-static-routes "24 , 106 , 31 , 64 , 10 , 0 , 0 , 3"
    ^
    Configuration file errors encountered -- exiting

    which to me indicates that the quotes are treated as an error by dhcpd. This is what I observe as well.

    The OP wrote:

    I put them in double quotes and it makes me space

    The OP's native language is clearly not English, but I can try to paraphrase this as:

    I entered the options using double quotes [in the webmin interface], and it accepted them like that

    In that case, the problem in [#4664] is simply user error, and webmin and dhcpd were both behaving correctly.

    I am using ISC DHCP version 4.1.1 (the stock one that comes with CentOS 6.7), and the 'man' page for dhcpd-options(5) contains the following short section:

       ARRAYS
    
       Options can contain arrays of any of the above types except
       for  the text and data string types, which arent currently
       supported in arrays.   An example of an array definition is
       as follows:
    
       option kerberos-servers code 200 = array of ip-address;
       option kerberos-servers 10.20.10.1, 10.20.11.1;
    

    So they should not be quoted.

    I am really sorry to have to ask you to revert your earlier change. Would you like me to contact the OP and try to clarify the situation first?

     

    Related

    Bugs: #4664

  • Jamie Cameron

    Jamie Cameron - 2016-06-19
    • status: open --> closed-fixed
     
  • Jamie Cameron

    Jamie Cameron - 2016-06-19

    Ok, I see the issue now .. I've checked in a fix for this, which will be included in the next Webmin release.

     

Log in to post a comment.