rpcd-mod-luci: refactor host hint gathering
authorJo-Philipp Wich <jo@mein.io>
Mon, 14 Jun 2021 18:47:11 +0000 (20:47 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 14 Jun 2021 19:52:56 +0000 (21:52 +0200)
commita78b74784dc1d4a4007e3e21a79228d5192f0dad
tree377ab536f5a9162775ba260a383634035e7f10e9
parent4286c84825c15f4d36f294b2ea28071667a4be7e
rpcd-mod-luci: refactor host hint gathering

 - Do not incorrectly put the IP addresses from the rrdns reply into the
   first hint, instead distribute hostnames to the appropriate hints.

 - Avoid returning stale lease information from previously parsed records
   by clearing the static struct before each parse attempt.

 - Improve existing checks for empty MAC addresses and unspecified IPv6
   addresses.

Fixes: #5126
Fixes: 87bcf9e923 ("rpcd-mod-luci: Return array of addresses in getHostHints")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
libs/rpcd-mod-luci/src/luci.c