MartijnBraam / python-isc-dhcp-leases

Small python module for reading /var/lib/dhcp/dhcpd.leases from isc-dhcp-server
MIT License
123 stars 47 forks source link

lease6 host_identifier incorrectly converted #7

Closed freddy36 closed 9 years ago

freddy36 commented 9 years ago

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).

MartijnBraam commented 9 years ago

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...

MartijnBraam commented 9 years ago

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