rpcd-mod-luci: refactor host hint gathering
authorJo-Philipp Wich <[email protected]>
Mon, 14 Jun 2021 18:47:11 +0000 (20:47 +0200)
committerJo-Philipp Wich <[email protected]>
Mon, 14 Jun 2021 19:53:32 +0000 (21:53 +0200)
commite0a32b2749f3d8ecb0de96874a153df940b7c567
treed7256b8d459785eca1fafe8482a011bfee33dc55
parent2778366916f815d4af9534218bef10aa3aad3c01
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 <[email protected]>
(cherry picked from commit a78b74784dc1d4a4007e3e21a79228d5192f0dad)
libs/rpcd-mod-luci/src/luci.c