Bug #962

DHCP custom options must have type selection

Added by Chris Buechler almost 9 years ago. Updated over 8 years ago.

DHCP Server
Target version:
Start date:
Due date:
% Done:


Estimated time:
Affected Version:
Affected Architecture:


The custom DHCP options are currently all added as text type. This doesn't work for many options, which require a different type. e.g. option 2 must be 'integer signed 32'.

To resolve, we need a drop down box added for each custom option to select the type. The possible options are:

integer unsigned 8
integer unsigned 16
integer unsigned 32
integer signed 8
integer signed 16
integer signed 32

See also:

Note for some of these types, the data is not enclosed in quotes, such as integers for one.

There are a couple other types, but not ones we're concerned with at this time.

Associated revisions

Revision 678dfd0f (diff)
Added by Erik Fonnesbeck almost 9 years ago

Add a setting for the data type of values used with DHCP option numbers and input validation for each type. Fixes #962

Revision 1452fa57 (diff)
Added by Erik Fonnesbeck almost 9 years ago

Use correct names for integer and boolean types in DHCP options and fix typo in hexadecimal validation for strings. Fixes #962


#1 Updated by Erik Fonnesbeck almost 9 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#2 Updated by Jon Bruce almost 9 years ago

Functions on Mon Nov 1 15:45:03 EDT 2010 firmware. Tested with "1(" for a Motorola TEAM phone which grabs Option 43 - vendor specific information from the DHCP server.

This is handy, thanks for the request and thanks to the developers for adding it!

#3 Updated by Chris Buechler almost 9 years ago

  • Status changed from Feedback to New
  • Priority changed from Normal to High
  • % Done changed from 100 to 90

One issue with this on the integers. It's putting int8, int16, uint8, etc. into dhcpd.conf file which is invalid syntax. It has to be exactly as listed in the original ticket, rather than 'int8', 'integer 8'. 'uint8' must be 'integer unsigned 8'. etc.

#4 Updated by Erik Fonnesbeck almost 9 years ago

  • Status changed from New to Feedback
  • % Done changed from 90 to 100

#5 Updated by Josh Stompro over 8 years ago

This fix/feature worked just fine with the Sun Dec 5th 07:23:23 EST 2010 nanobsd snapshot.

I added one option of each type to my lan dhcp config, and the results in the dhcpd.conf file are as follows.

option custom-lan-0 code 128 = text;
option custom-lan-1 code 4 = string;
option custom-lan-2 code 5 = boolean;
option custom-lan-3 code 6 = unsigned integer 8;
option custom-lan-4 code 7 = unsigned integer 16;
option custom-lan-5 code 8 = unsigned integer 32;
option custom-lan-6 code 9 = signed integer 8;
option custom-lan-7 code 10 = signed integer 16;
option custom-lan-8 code 11 = signed integer 32;
option custom-lan-9 code 12 = ip-address;
option custom-opt1-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 "";
        option domain-search-list "";
        option domain-name-servers;

        option custom-lan-0 "VLAN-A=100;";
        option custom-lan-1 "Test string";
        option custom-lan-2 true;
        option custom-lan-3 6;
        option custom-lan-4 7;
        option custom-lan-5 8;
        option custom-lan-6 9;
        option custom-lan-7 10;
        option custom-lan-8 11;
        option custom-lan-9;

Looks correct to me.

#6 Updated by Ermal Lu├ži over 8 years ago

  • Status changed from Feedback to Resolved

Thank you for testing.

Also available in: Atom PDF