Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 985da199 authored by hepengtao's avatar hepengtao Committed by Remi NGUYEN VAN
Browse files

NSD: Specify on what interface to getAddrInfo



When discover two different host with same host name
from different network interface, specify on what
 interface to getAddrInfo.

Bug: 203453164
Test: build & manual

Signed-off-by: default avatarhepengtao <hept.hept.hept@gmail.com>
Change-Id: Ifaccb7f3fac6b1dd789cc9ce7c8d964102754508
parent 27c75f17
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -488,7 +488,7 @@ public class NsdService extends INsdManager.Stub {
                        removeRequestMap(clientId, id, clientInfo);

                        int id2 = getUniqueId();
                        if (getAddrInfo(id2, cooked[3])) {
                        if (getAddrInfo(id2, cooked[3], cooked[7])) {
                            storeRequestMap(clientId, id2, clientInfo, NsdManager.RESOLVE_SERVICE);
                        } else {
                            clientInfo.onResolveServiceFailed(
@@ -833,8 +833,8 @@ public class NsdService extends INsdManager.Stub {
        return mDaemon.execute("stop-resolve", resolveId);
    }

    private boolean getAddrInfo(int resolveId, String hostname) {
        return mDaemon.execute("getaddrinfo", resolveId, hostname);
    private boolean getAddrInfo(int resolveId, String hostname, String interfaceName) {
        return mDaemon.execute("getaddrinfo", resolveId, hostname, interfaceName);
    }

    private boolean stopGetAddrInfo(int resolveId) {