tag 460833 +patch
thanks
>From what I understand, option_space_encapsulate() has become a bit more
verbose in 3.1.0, thus revealing a bug in cons_options() where DHCP
agent options are always processed, even though they don't apply to the
client.
Here's a naïve patch that appears to solve the issue for me. Standard
disclaimer applies.
--
<sangr> home is where the highest bandwidth is
--- common/options.c 2007-05-23 15:26:22.000000000 -0400
+++ /var/cache/pbuilder/build/19292/root/dhcp3-3.1.0/common/options.c 2008-01-26 01:25:24.000000000 -0500
@@ -750,16 +750,18 @@
need_endopt = 1;
length = DHCP_FIXED_NON_UDP + mainbufix;
- /* Now hack in the agent options if there are any. */
- priority_list [0] = DHO_DHCP_AGENT_OPTIONS;
- priority_len = 1;
- agentix +=
- store_options (0, &outpacket -> options [agentix],
- DHCP_OPTION_LEN - agentix,
- inpacket, lease, client_state,
- in_options, cfg_options, scope,
- priority_list, priority_len,
- 0, 0, 0, (char *)0);
+ if (client_state == NULL) {
+ /* Now hack in the agent options if there are any. */
+ priority_list [0] = DHO_DHCP_AGENT_OPTIONS;
+ priority_len = 1;
+ agentix +=
+ store_options (0, &outpacket -> options [agentix],
+ DHCP_OPTION_LEN - agentix,
+ inpacket, lease, client_state,
+ in_options, cfg_options, scope,
+ priority_list, priority_len,
+ 0, 0, 0, (char *)0);
+ }
/* Tack a DHO_END option onto the packet if we need to. */
if (agentix < DHCP_OPTION_LEN && need_endopt)