Silence the obnoxious MTU 0 error message that occur when no MTU is
specified for a given network.
Bug: 10705136
Change-Id: I637d3b62ca6bb3de217d1eb03cdb1668622d06f1
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 4300920..5c7c697 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -1655,11 +1655,14 @@
private void updateMtu(LinkProperties newLp, LinkProperties oldLp) {
final String iface = newLp.getInterfaceName();
final int mtu = newLp.getMtu();
+ if (oldLp == null && mtu == 0) {
+ // Silently ignore unset MTU value.
+ return;
+ }
if (oldLp != null && newLp.isIdenticalMtu(oldLp)) {
if (VDBG) log("identical MTU - not setting");
return;
}
-
if (LinkProperties.isValidMtu(mtu, newLp.hasGlobalIPv6Address()) == false) {
loge("Unexpected mtu value: " + mtu + ", " + iface);
return;