problems with log and options that are set.

Michal Kostěnec kostenec at
Thu Oct 10 06:07:21 UTC 2013

Hi Doug,
try change directive 'option' to  'config-option' in log function:

log (info, concat ("DHCPAGENT assigning user-class1: ", config-option porthash));


On 9. 10. 2013, at 20:25, "Hughes, Doug" <Douglas.Hughes at> wrote:

> Shouldn’t it work to set an option and then log what was set? Or to set any arbitrary (temporary) variable that you’ve created? I want to dynamically build a variable and then use that for the host identifier match to hand out a fixed address based upon the agent.remote-id *AND* agent.circuit-id.
> I see from googling for the last week that a lot of people have tried this with varying degrees of hackishness and success since the dhcpd doesn’t support this directly. I’ve tried subclassing, but you can’t do an allow from a subclass for a pool of 1 IP (another hack). I’ve even looked at patches released in the past for this problem.
> But, back to the specific problem, one of debugging.
> Take this statement:
> option porthash code 214 = text;
> if exists agent.circuit-id
> {
>         if option agent.circuit-id ~= ":" {
>                 log (info, concat ("DHCPAGENT ", "stuff"));
>                 log (info, concat ("DHCPAGENT lease of ", binary-to-ascii (10,8, ".", leased-address), " for agent ", option agent.remote-id, " on ", option agent.circuit-id));
>                 option porthash = concat(substring(option agent.remote-id,0,10), "_", substring(option agent.circuit-id, 0, 10));
>                 log (info, concat ("DHCPAGENT assigning user-class1: ", option porthash));
>                 log (info, concat ("DHCPAGENT assigning user-class2: ", option agent.remote-id, "_", option agent.circuit-id ));
>                 log (info, concat ("DHCPAGENT", " post"));
>        }
> }
> It prints:
> DHCPAGENT lease of for agent s55-test on 53:0:26
> DHCPAGENT assigning user-class2: s55-test_53:0:26
> So:
> I have proven (to myself at least) that:
> the concatenation of agent.remote-id “_” and agent.circuit-id is a string.
> The above string will log correctly
> If I use any option (pre-existing, or defined. I have tried this with dhcp-client-identifier which is pre-defined) the log will fail, silently
> If I use any temporary variable in the log statement that I assign instead of the porthash example above, it will fail.
> Can anybody explain what is going on with the silent failure of the log statement? Why doesn’t it log? Why doesn’t it generate any error or output at all about the failure
> Of the log?  This makes debugging quite difficult…
> Thanks
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the dhcp-users mailing list