Conf question - how to print hardware address
ggersh at ctc.net
Wed Oct 18 16:16:56 UTC 2006
Jon Otterholm wrote:
> Staffan.Ungsgard at teliasonera.com wrote:
>> In a log message statement I want to print the MAC address of the client making a dhcp request.
>> Using "log (info, substring(hardware, 1, 6));" I get the MAC address printed as 0:10:e:12:3:12 instead of 00:10:0e:12:03:12 which is the way it is logged by the dhcp server making it's standard log entries (logging DISCOVERs etc).
> Try this:
> log(info, concat("commit", " ", binary-to-ascii(10, 8, ".",
> leased-address), " ", concat (
> suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 1,
> Got this from someone earlier when I had the same problem.
That's fairly ugly. It works, of course. Is there any chance of a
printf-like structure for logging in a future version?
More information about the dhcp-users