Dhcp_host_domain_ng.py: Add_lease, hostname check failed

… just adding my feedback …
For some time i have all fine. Add/Refresh/Delete lease steps were working fine. Yesterday i found that there are again “hostname check failed” with following “DHCP unknown operation” messages in syslog.

I did the diff/check of actual version with above linked change/fix. That does not helped much (later i found that there are hardcoded definitions for path where lease files are located. (i have them in /srv not in /tmp). That helped for most of the hosts/hostnames (dynamic domain ones). When i tried wlan0 to wlan1 or to gues0 wifis, it was having some more warnings (issue during delete and upcoming new add).
I found that one of static lease entry with “*” instead of hostname that in lease file (static one) is probably reason why it behave like that. --> causing warnings/errors during “kresd refresh lease” and “add_lease” steps.
So i’ve put that static-lease host /hostname to my LuCi/Hostnames (without domain suffix and in lower case) as well together with changing the /etc/hosts accordingly (i have only fullname entries there).

Now it seems that “dhcp uknown operation” is no longer poping-up in log neither “hostname check failed” during add/update(del/add) lease. In my case that * in lease file and missing entry in luci/hostnames was root cause. Seems my SmartTV is having option to change netbios name, but not hostname (actually i think there is none, so maybe that is reflected by * ).

I can confirm @datapool hints and script fix are working pretty nice. Just ensure that after adding static lease entry via Luci is reflected correctly in dhcp.lease (eventually add that static-lease host to luci/hostnames).

notes:

i am using different location for dhcp files instead of /tmp i have it /srv …so i had to change hardcoded path/locations in that .py script as well (and create dhcp.empty , that one was not present on my system so far). for backward compatibility i have symlink in /tmp created for each file. I am wondering why those locations in dhcp uci config are not used like any other uci entries.