Menu

#701 Error when specifying a DHCP option value with a period

1.4.18
open
None
5
2008-05-25
2008-05-22
No

IPCop 1.4.18
When adding a DHCP option/parameter for PXE boot file pxelinux.0 I get an error message.

If I specify the parameter "file name" I get:
/etc/dhcpd.conf line 16: expecting a parameter or declaration
filename pxelinux.0;

If I specify the option "bootfile-name" I get:
/etc/dhcpd.conf line 17: semicolon expected.
option bootfile-name pxelinux.
^
This doesn't occur with file name specified in a fixed lease. The workaround is to use quotes: "pxelinux.0"

Discussion

  • Eric Oberlander

    Eric Oberlander - 2008-05-25

    Diff file

     
  • Eric Oberlander

    Eric Oberlander - 2008-05-25

    Logged In: YES
    user_id=604669
    Originator: NO

    I created a patch that adds double quotes to certain text strings. I'm sure it can be improved.

    Eric
    File Added: dhcp.cgi-string.patch

     
  • Eric Oberlander

    Eric Oberlander - 2008-05-25
    • milestone: --> 1.4.18
    • assigned_to: nobody --> gespinasse
     
  • Gilles Espinasse

    Logged In: YES
    user_id=691649
    Originator: NO

    Thank for you report.

    Anyway, you may not need to use the complicated dhcp options to just pxe-boot one machine.

    Directly fill "Next-Server" entry with the IP address of the tftp server and "Filename" with pxelinux.0

     
  • Eric Oberlander

    Eric Oberlander - 2008-05-25

    Logged In: YES
    user_id=604669
    Originator: NO

    Actually, the more I think about it, this may not be a bug, but more of an RFE.

    It is quite hard to error check all the possible options, particularly as some can be user-defined.

    dhcp.cgi DID work in that it flagged up an error, which you were able to resolve.

    http://linux.die.net/man/5/dhcpd-options does specify that 'The text data type specifies an NVT ASCII string, which must be enclosed in double quotes', but also that 'The string data type specifies either an NVT ASCII string enclosed in double quotes, or a series of octets specified in hexadecimal, separated by colons.'

    The 'string' data type would be hard to check, when there are two possible formats.

    Maybe we should leave it as it is?

    Eric

     
  • Jeff D. Hanson

    Jeff D. Hanson - 2008-05-26

    Logged In: YES
    user_id=726135
    Originator: YES

    I would prefer it done correctly but a more informative error message suggesting the use of double-quotes would be adequate. Isn't the string checking applicable to other DHCP fields as well? It would seem rather generic.

     
  • Olaf Westrik

    Olaf Westrik - 2008-05-27

    Logged In: YES
    user_id=1120714
    Originator: NO

    There is another problem with dhcp.cgi and options: http://www.ipcop-forum.de/forum/viewtopic.php?f=27&t=15774

    I suggest to leave as is, IMHO dhcp.cgi must be redone as currently the options definition and options assignment are kept in 1 config file (dhcp/advoptions) and use the same CGI input fields.
    Too complicated and fairly easy to get wrong.

     

Log in to post a comment.