Loading services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java +4 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,9 @@ public class TetheringConfiguration { dumpStringArray(pw, "provisioningApp", provisioningApp); pw.print("provisioningAppNoUi: "); pw.println(provisioningAppNoUi); pw.print("enableLegacyDhcpServer: "); pw.println(enableLegacyDhcpServer); } public String toString() { Loading @@ -176,6 +179,7 @@ public class TetheringConfiguration { makeString(preferredUpstreamNames(preferredUpstreamIfaceTypes)))); sj.add(String.format("provisioningApp:%s", makeString(provisioningApp))); sj.add(String.format("provisioningAppNoUi:%s", provisioningAppNoUi)); sj.add(String.format("enableLegacyDhcpServer:%s", enableLegacyDhcpServer)); return String.format("TetheringConfiguration{%s}", sj.toString()); } Loading services/net/java/android/net/dhcp/DhcpLease.java +6 −1 Original line number Diff line number Diff line Loading @@ -130,9 +130,14 @@ public class DhcpLease { return HexDump.toHexString(bytes); } static String inet4AddrToString(@Nullable Inet4Address addr) { return (addr == null) ? "null" : addr.getHostAddress(); } @Override public String toString() { return String.format("clientId: %s, hwAddr: %s, netAddr: %s, expTime: %d, hostname: %s", clientIdToString(mClientId), mHwAddr.toString(), mNetAddr, mExpTime, mHostname); clientIdToString(mClientId), mHwAddr.toString(), inet4AddrToString(mNetAddr), mExpTime, mHostname); } } services/net/java/android/net/dhcp/DhcpLeaseRepository.java +8 −5 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.net.NetworkUtils.inet4AddressToIntHTH; import static android.net.NetworkUtils.intToInet4AddressHTH; import static android.net.NetworkUtils.prefixLengthToV4NetmaskIntHTH; import static android.net.dhcp.DhcpLease.EXPIRATION_NEVER; import static android.net.dhcp.DhcpLease.inet4AddrToString; import static android.net.util.NetworkConstants.IPV4_ADDR_BITS; import static java.lang.Math.min; Loading Loading @@ -252,7 +253,7 @@ class DhcpLeaseRepository { final DhcpLease lease = checkClientAndMakeLease(clientId, hwAddr, leaseAddr, hostname, currentTime); mLog.logf("DHCPREQUEST assignedLease %s, reqAddr=%s, sidSet=%s: created/renewed lease %s", assignedLease, reqAddr, sidSet, lease); assignedLease, inet4AddrToString(reqAddr), sidSet, lease); return lease; } Loading Loading @@ -304,7 +305,7 @@ class DhcpLeaseRepository { @NonNull Inet4Address addr) { final DhcpLease currentLease = mCommittedLeases.getOrDefault(addr, null); if (currentLease == null) { mLog.w("Could not release unknown lease for " + addr); mLog.w("Could not release unknown lease for " + inet4AddrToString(addr)); return false; } if (currentLease.matchesClient(clientId, hwAddr)) { Loading @@ -319,12 +320,13 @@ class DhcpLeaseRepository { public void markLeaseDeclined(@NonNull Inet4Address addr) { if (mDeclinedAddrs.containsKey(addr) || !isValidAddress(addr)) { mLog.logf("Not marking %s as declined: already declined or not assignable", addr); mLog.logf("Not marking %s as declined: already declined or not assignable", inet4AddrToString(addr)); return; } final long expTime = mClock.elapsedRealtime() + mLeaseTimeMs; mDeclinedAddrs.put(addr, expTime); mLog.logf("Marked %s as declined expiring %d", addr, expTime); mLog.logf("Marked %s as declined expiring %d", inet4AddrToString(addr), expTime); maybeUpdateEarliestExpiration(expTime); } Loading Loading @@ -515,7 +517,8 @@ class DhcpLeaseRepository { while (it.hasNext()) { final Inet4Address addr = it.next(); it.remove(); mLog.logf("Out of addresses in address pool: dropped declined addr %s", addr); mLog.logf("Out of addresses in address pool: dropped declined addr %s", inet4AddrToString(addr)); // isValidAddress() is always verified for entries in mDeclinedAddrs. // However declined addresses may have been requested (typically by the machine that was // already using the address) after being declined. Loading Loading
services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java +4 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,9 @@ public class TetheringConfiguration { dumpStringArray(pw, "provisioningApp", provisioningApp); pw.print("provisioningAppNoUi: "); pw.println(provisioningAppNoUi); pw.print("enableLegacyDhcpServer: "); pw.println(enableLegacyDhcpServer); } public String toString() { Loading @@ -176,6 +179,7 @@ public class TetheringConfiguration { makeString(preferredUpstreamNames(preferredUpstreamIfaceTypes)))); sj.add(String.format("provisioningApp:%s", makeString(provisioningApp))); sj.add(String.format("provisioningAppNoUi:%s", provisioningAppNoUi)); sj.add(String.format("enableLegacyDhcpServer:%s", enableLegacyDhcpServer)); return String.format("TetheringConfiguration{%s}", sj.toString()); } Loading
services/net/java/android/net/dhcp/DhcpLease.java +6 −1 Original line number Diff line number Diff line Loading @@ -130,9 +130,14 @@ public class DhcpLease { return HexDump.toHexString(bytes); } static String inet4AddrToString(@Nullable Inet4Address addr) { return (addr == null) ? "null" : addr.getHostAddress(); } @Override public String toString() { return String.format("clientId: %s, hwAddr: %s, netAddr: %s, expTime: %d, hostname: %s", clientIdToString(mClientId), mHwAddr.toString(), mNetAddr, mExpTime, mHostname); clientIdToString(mClientId), mHwAddr.toString(), inet4AddrToString(mNetAddr), mExpTime, mHostname); } }
services/net/java/android/net/dhcp/DhcpLeaseRepository.java +8 −5 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.net.NetworkUtils.inet4AddressToIntHTH; import static android.net.NetworkUtils.intToInet4AddressHTH; import static android.net.NetworkUtils.prefixLengthToV4NetmaskIntHTH; import static android.net.dhcp.DhcpLease.EXPIRATION_NEVER; import static android.net.dhcp.DhcpLease.inet4AddrToString; import static android.net.util.NetworkConstants.IPV4_ADDR_BITS; import static java.lang.Math.min; Loading Loading @@ -252,7 +253,7 @@ class DhcpLeaseRepository { final DhcpLease lease = checkClientAndMakeLease(clientId, hwAddr, leaseAddr, hostname, currentTime); mLog.logf("DHCPREQUEST assignedLease %s, reqAddr=%s, sidSet=%s: created/renewed lease %s", assignedLease, reqAddr, sidSet, lease); assignedLease, inet4AddrToString(reqAddr), sidSet, lease); return lease; } Loading Loading @@ -304,7 +305,7 @@ class DhcpLeaseRepository { @NonNull Inet4Address addr) { final DhcpLease currentLease = mCommittedLeases.getOrDefault(addr, null); if (currentLease == null) { mLog.w("Could not release unknown lease for " + addr); mLog.w("Could not release unknown lease for " + inet4AddrToString(addr)); return false; } if (currentLease.matchesClient(clientId, hwAddr)) { Loading @@ -319,12 +320,13 @@ class DhcpLeaseRepository { public void markLeaseDeclined(@NonNull Inet4Address addr) { if (mDeclinedAddrs.containsKey(addr) || !isValidAddress(addr)) { mLog.logf("Not marking %s as declined: already declined or not assignable", addr); mLog.logf("Not marking %s as declined: already declined or not assignable", inet4AddrToString(addr)); return; } final long expTime = mClock.elapsedRealtime() + mLeaseTimeMs; mDeclinedAddrs.put(addr, expTime); mLog.logf("Marked %s as declined expiring %d", addr, expTime); mLog.logf("Marked %s as declined expiring %d", inet4AddrToString(addr), expTime); maybeUpdateEarliestExpiration(expTime); } Loading Loading @@ -515,7 +517,8 @@ class DhcpLeaseRepository { while (it.hasNext()) { final Inet4Address addr = it.next(); it.remove(); mLog.logf("Out of addresses in address pool: dropped declined addr %s", addr); mLog.logf("Out of addresses in address pool: dropped declined addr %s", inet4AddrToString(addr)); // isValidAddress() is always verified for entries in mDeclinedAddrs. // However declined addresses may have been requested (typically by the machine that was // already using the address) after being declined. Loading