[srp-server] notify advertising proxy of host/service expiration (#6248)

There is an issue that the SRP host or service are not deregistered by
the Advertising Proxy when the host or service is expired. This is
because we didn't notifies the Advertising Proxy of the host/service
expiration. This commit fixes this issue and adds tests for it.
This commit is contained in:
kangping
2021-03-15 23:32:14 +08:00
committed by GitHub
parent 6c9d4b3f9e
commit e992b8461c
4 changed files with 143 additions and 65 deletions
+3 -2
View File
@@ -2741,9 +2741,10 @@ class LinuxHost():
#
for line in self.bash(f'cat /tmp/{host_name}'):
elements = line.split()
if not elements or len(elements) < 6 or not elements[4].startswith(host_name):
fullname = f'{host_name}.local.'
if fullname not in elements:
continue
addresses.append(elements[5].split('%')[0])
addresses.append(elements[elements.index(fullname) + 1].split('%')[0])
logging.debug(f'addresses of {host_name}: {addresses}')