Subnet selection option

Ted Lemon Ted_Lemon at isc.org
Thu Aug 26 13:42:19 UTC 1999


> Hmmm, needn't the subnet selection option be defined in the list of
> options in tables.c and in dhcp.h first?

Yes.   It's not defined yet because I don't have a number for it.

> I'm having problem figuring out what function to use to check if
> that option is sent in the received packet. I bet there is
> one... I'll keep searching the code until I figure it out, or until
> you show up with the answer ;-)

Here's a code fragment that looks up the dhcp-requested-address
option:

	oc = lookup_option (&dhcp_universe, packet -> options,
			    DHO_DHCP_REQUESTED_ADDRESS);
	memset (&data, 0, sizeof data);
	if (oc &&
	    evaluate_option_cache (&data, packet, (struct lease *)0,
				   packet -> options, (struct option_state *)0,
				   oc)) {
		cip.len = 4;
		memcpy (cip.iabuf, data.data, 4);
		data_string_forget (&data, "dhcprequest");
	}

This is probably quite similar to what you'd use to get the subnet
selection option value.

			       _MelloN_


More information about the dhcp-hackers mailing list