Does "option dhcp-message-type" work?

Bret Schuhmacher bret at welcometolazyhill.com
Tue Jul 22 00:55:43 UTC 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Thanks, David!!  You saved the day!  I was not aware of the on commit 
feature.  Thanks for pointing it out - it was exactly what I needed.  
Thanks very much!

Rgds,

Bret

David W. Hankins wrote:
| On Mon, Jul 21, 2008 at 03:22:16PM -0400, Bret Schuhmacher wrote:
|> if dhcp-message-type = 5 {
|> log (info, concat(binary-to-ascii (10, 8, ".", leased-address), ",",
|> binary-to-ascii (10,32,"",encode-int (lease-time,32)), ",",
|> binary-to-ascii (16, 8, ":", substring (hardware, 1, 6)), "," ,
|> binary-to-ascii(16, 8, ":", substring( option agent.remote-id, 0, 6))));
|> }
|
| i think 'dhcp-message-type' gets parsed as a variable name for a
| 'binding scope', whereas 'option dhcp-message-type' gets looked up in
| the packet's option cache.
|
| this actually is a terribly insidious and frighteningly longstanding
| bug in our parser (example taken from our bug tracking system);
|
|     authoritive;
|
| is mispelled from what was intended by its author, but the parser
| constructs it internally as a no-op executable statement, deriving
| the value of the binding scope labeled 'authoritive', and then
| discarding the result.
|
| short of asking dhcpd.conf authors to 'foreword' all the binding
| scope variable names they are going to be using, a solution has not
| quite bubbled to the surface.
|
|> If I comment out the "if" and run it I get 2 lines of logging,
|> presumably from the DHCPOFFER and the DHCPACK.  I only want to log the
|> ACK.  Is there another method I could try?
|
| some folks have been known to use the 'on commit' config feature.
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
 
iD8DBQFIhTAN/PgQIGRJuUcRAs0aAJoDIOGR6ezAe8eQGJsTPbItMN36DACfZ49f
biBOG92BawylaMdbC2QXKgg=
=TAz3
-----END PGP SIGNATURE-----



More information about the dhcp-users mailing list