Merge "ClatCoordinator: close tun fd if detect mtu failed"
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