Silence the obnoxious MTU 0 error message that occur when no MTU is
specified for a given network.
Bug: 10705136
(cherry picked from commit 07c53a35ae)
Change-Id: I89e2fdfbbfa981d435a2974422d9d9c009872d76
This commit is contained in:
committed by
Lorenzo Colitti
parent
adb7a1c631
commit
e3b646f25d
@@ -1804,11 +1804,14 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
private void updateMtu(LinkProperties newLp, LinkProperties oldLp) {
|
private void updateMtu(LinkProperties newLp, LinkProperties oldLp) {
|
||||||
final String iface = newLp.getInterfaceName();
|
final String iface = newLp.getInterfaceName();
|
||||||
final int mtu = newLp.getMtu();
|
final int mtu = newLp.getMtu();
|
||||||
|
if (oldLp == null && mtu == 0) {
|
||||||
|
// Silently ignore unset MTU value.
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (oldLp != null && newLp.isIdenticalMtu(oldLp)) {
|
if (oldLp != null && newLp.isIdenticalMtu(oldLp)) {
|
||||||
if (VDBG) log("identical MTU - not setting");
|
if (VDBG) log("identical MTU - not setting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LinkProperties.isValidMtu(mtu, newLp.hasGlobalIPv6Address()) == false) {
|
if (LinkProperties.isValidMtu(mtu, newLp.hasGlobalIPv6Address()) == false) {
|
||||||
if (mtu != 0) loge("Unexpected mtu value: " + mtu + ", " + iface);
|
if (mtu != 0) loge("Unexpected mtu value: " + mtu + ", " + iface);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user