[Dnsmasq-discuss] Support for DHCP option 125

Simon Kelley simon at thekelleys.org.uk
Fri Sep 14 16:31:55 BST 2007

~ Kunal Sharma ~ wrote:
> Hi Friends,
> I'm new to this list and I'm new to DNSMASQ. Hence, this query !
> I need to be able to add/enable support for DHCP option number 125 in
> my current implementation. At this point, since I've not had a look
> in, I'm not even aware that this is already there or not.
> Would anyone here be generous to help me with the following -
> 1) How to find out if this option is supported and/or enabled ? 

Asking here is good. The answer is that it's not supported, except in 
the sense that you can code absolutely any option as a sequence of hex 
octets. Since RFC3925 options are fairly complex, that's probably not a 
good solution unless you have one, very simple option to encapsulate.

> 2) If this is supported but disabled, how do I enable it (some compilation
> flag etc) ? 


 > 3) If I need to add support, how to go about it e.g.
> general directions needed, not the spoon-feeding stuff. 

The existing support for non-vendor-identifying encapsulated options is 
in two places. The data gets laid out in the packet in the second half 
of do_options() in src/rfc2131.c. That's quite hairy code, but it should 
be extendable to option 125 without too many problems.

dhcp-option lines in the config file and command line are parsed into a 
linked-list of struct dhcp_opt in parse_dhcp_opt() in src/option.c. 
That's hairy too (sorry!). option-60 encapsulated options look like:

dhcp-option=vendor:<some vendor string>,<option data>

That could be extended to cope with something like

dhcp-option=vendor-id:<enterprise-number>,<option data>

> Also, am I
> freely allowed to make my own changes to DNSMASQ ?

dnsmasq is licensed under the GNU GPL, in the unlikely event that you're 
not familiar with that, Googling will find you several decades worth of 
reading very quickly. The deal is basically this: you can make changes 
to dnsmasq for your own use: if you sell/give the changed binary to 
anyone outside your organisation, you have to make the changed source 
code available as well (and under the same terms).

If you add this functionality, I'd appreciate getting a copy of the patch.



More information about the Dnsmasq-discuss mailing list