Merge "ClatCoordinator: close tun fd if detect mtu failed" am: 0750626dd0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2109964 Change-Id: I5978450e855123a90fd793881a9f501960a9dd16 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -570,8 +570,14 @@ public class ClatCoordinator {
|
|||||||
|
|
||||||
// Detect ipv4 mtu.
|
// Detect ipv4 mtu.
|
||||||
final Integer fwmark = getFwmark(netId);
|
final Integer fwmark = getFwmark(netId);
|
||||||
final int detectedMtu = mDeps.detectMtu(pfx96Str,
|
final int detectedMtu;
|
||||||
|
try {
|
||||||
|
detectedMtu = mDeps.detectMtu(pfx96Str,
|
||||||
ByteBuffer.wrap(GOOGLE_DNS_4.getAddress()).getInt(), fwmark);
|
ByteBuffer.wrap(GOOGLE_DNS_4.getAddress()).getInt(), fwmark);
|
||||||
|
} catch (IOException e) {
|
||||||
|
tunFd.close();
|
||||||
|
throw new IOException("Detect MTU on " + tunIface + " failed: " + e);
|
||||||
|
}
|
||||||
final int mtu = adjustMtu(detectedMtu);
|
final int mtu = adjustMtu(detectedMtu);
|
||||||
Log.i(TAG, "ipv4 mtu is " + mtu);
|
Log.i(TAG, "ipv4 mtu is " + mtu);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user