MartijnBraam / python-isc-dhcp-leases

Small python module for reading /var/lib/dhcp/dhcpd.leases from isc-dhcp-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lease6 host_identifier incorrectly converted

freddy36 opened this issue · comments

Hello,

in _iaid_duid_to_bytes() the octal escaped values are converted to decimal escaped values before decoding them as unicode_escape.
AFAIK unicode_escape expects octal escaped values.
The current conversion results in incorrect values.
So _iaid_duid_to_bytes shouldn't do any octal to dec conversion (Just directly unicode_escape decode the input_string).

Hmm I've done some tests and hand decoding but it seems you're right about unicode_escape. I assumed it would to wierd things with ocal values between 100 and 254 since those values are kind of ambigious without prefix zero...

assumptions...

I've simplyfied the host_identifier parser and reverted your test values. Now it seems correct, please reopen if it's still wrong.