mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1174998 - Part 2: Set MTU for connected network interfaces. r=echen
This commit is contained in:
parent
ed986a674a
commit
9b8f929f77
@ -99,6 +99,7 @@ function ExtraNetworkInfo(aNetwork) {
|
||||
this.dnses = aNetwork.info.getDnses();
|
||||
this.httpProxyHost = aNetwork.httpProxyHost;
|
||||
this.httpProxyPort = aNetwork.httpProxyPort;
|
||||
this.mtu = aNetwork.mtu;
|
||||
}
|
||||
ExtraNetworkInfo.prototype = {
|
||||
getAddresses: function(aIps, aPrefixLengths) {
|
||||
@ -369,6 +370,13 @@ NetworkManager.prototype = {
|
||||
return this.setSecondaryDefaultRoute(extNetworkInfo);
|
||||
})
|
||||
.then(() => this._addSubnetRoutes(extNetworkInfo))
|
||||
.then(() => {
|
||||
if (extNetworkInfo.mtu <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
return this._setMtu(extNetworkInfo);
|
||||
})
|
||||
.then(() => this.setAndConfigureActive())
|
||||
.then(() => {
|
||||
// Update data connection when Wifi connected/disconnected
|
||||
@ -943,6 +951,18 @@ NetworkManager.prototype = {
|
||||
});
|
||||
},
|
||||
|
||||
_setMtu: function(aNetworkInfo) {
|
||||
return new Promise((aResolve, aReject) => {
|
||||
gNetworkService.setMtu(aNetworkInfo.name, aNetworkInfo.mtu, (aSuccess) => {
|
||||
if (!aSuccess) {
|
||||
debug("setMtu failed");
|
||||
}
|
||||
// Always resolve.
|
||||
aResolve();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
_createNetwork: function(aInterfaceName) {
|
||||
return new Promise((aResolve, aReject) => {
|
||||
gNetworkService.createNetwork(aInterfaceName, (aSuccess) => {
|
||||
|
@ -80,7 +80,7 @@ interface nsINetworkInfo : nsISupports
|
||||
[array, size_is(count), retval] out wstring dnses);
|
||||
};
|
||||
|
||||
[scriptable, uuid(9a025351-8684-4ab5-a0c1-f21a9f83d405)]
|
||||
[scriptable, uuid(8b1345fa-b34c-41b3-8d21-09f961bf8887)]
|
||||
interface nsINetworkInterface : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -97,4 +97,9 @@ interface nsINetworkInterface : nsISupports
|
||||
* The port number of the http proxy server.
|
||||
*/
|
||||
readonly attribute long httpProxyPort;
|
||||
|
||||
/*
|
||||
* The Maximun Transmit Unit for this network interface, -1 if not set.
|
||||
*/
|
||||
readonly attribute long mtu;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user