Handle downstream tethering interface addresses in MdnsSocketProvider

MdnsSocketProvider currently does not fill addresses of downstream
tethering interfaces in its callbacks. The interface addresses should be
properly updated by listening to the Netlink messages.

Test: atest FrameworksNetTests CtsNetTestCases
Bug: 267980538
Change-Id: I753e547a1b092703fe59c6c9e922ee8aca245f67
This commit is contained in:
Yuyang Huang
2023-03-08 16:17:05 +09:00
parent 5864b59462
commit 700778be70
6 changed files with 324 additions and 42 deletions

View File

@@ -1330,6 +1330,9 @@ public class NsdService extends INsdManager.Stub {
mDeps = deps;
mMdnsSocketProvider = deps.makeMdnsSocketProvider(ctx, handler.getLooper());
// Netlink monitor starts on boot, and intentionally never stopped, to ensure that all
// address events are received.
handler.post(mMdnsSocketProvider::startNetLinkMonitor);
mMdnsSocketClient =
new MdnsMultinetworkSocketClient(handler.getLooper(), mMdnsSocketProvider);
mMdnsDiscoveryManager =