A few problems with DHCP

  • Hi -

    I've been testing some of the new options on DHCP, such as tftp server, and "Additional DHCP" Options.  I found a few problems:

    1)  If you add a "numbered option" and then delete it, so you have no more left, the DHCP config screen will crap out on line 312 in services_dhcp.php.  I think you're just missing a if (isset …)

                   if ( isset($config['dhcpd'][$if]['numberoptions']['item']))

    the above seems to fix it.

    2)  some of the "numbered options" expect int32 or uint32, but it seems that the config always writes it as a string.  I haven't found where this happens yet.

    For instance to set tz offset in seconds, I'm east coast, so that would be -18000  DHCP option 2.    The config generated by the gui for this is below, but doesn't work:

    option domain-name "local";
    option ldap-server code 95 = text;
    option domain-search-list code 119 = text;
    option custom-opt-0 code 2 = text;
    default-lease-time 7200;
    max-lease-time 86400;
    log-facility local7;
    ddns-update-style none;
    one-lease-per-client true;
    deny duplicates;
    ping-check true;
    subnet netmask {
            pool {
            option routers;
            option domain-name-servers;
            option ntp-servers;
            option tftp-server-name "";
            option custom-opt-0 "-18000";

  • Rebel Alliance Developer Netgate

    Good catch :)

    It would probably be best to open this up as a ticket in redmine ( http://redmine.pfsense.org ) and if possible, include a diff/patch.

Log in to reply