dhclient: Using dhcp-lease-time in expressions

Jordan Russell jr-list-2011 at quo.to
Fri Dec 16 04:58:13 UTC 2011


[dhclient 4.2.1-P1]

For testing purposes, I'm attempting to set dhcp-renewal-time to 10% of
dhcp-lease-time. But I can't seem to figure out the right way to specify
dhcp-lease-time in a numeric expression.

Here's what I've tried:

(1) supersede dhcp-renewal-time = encode-int(lease-time / 10, 32);

(2) supersede dhcp-renewal-time =
      encode-int(extract-int(option dhcp-lease-time, 32) / 10, 32);

(3) supersede dhcp-renewal-time = encode-int(3000 / 10, 32);

Results:

(1) Fails with error:  "data: leased_lease: not available"

(2) No error, but doesn't produce any dhcp-renewal-time option in
    the leases file. (Perhaps because extract-int() returns null?)

(3) Using a constant works, so apparently the rest of the
    expression is correct.

Any ideas?

-- 
Jordan Russell



More information about the dhcp-users mailing list