Bug 908135 - Remove dhcp attribute in nsINetworkInterface. r=vyang, vchang

This commit is contained in:
Edgar Chen 2013-08-22 17:43:53 +08:00
parent 5fea521976
commit 10355a0807
5 changed files with 2 additions and 29 deletions

View File

@ -321,7 +321,6 @@ NetworkManager.prototype = {
state: i.state,
type: i.type,
name: i.name,
dhcp: i.dhcp,
ip: i.ip,
netmask: i.netmask,
broadcast: i.broadcast,
@ -597,7 +596,7 @@ NetworkManager.prototype = {
setDefaultRouteAndDNS: function setDefaultRouteAndDNS(oldInterface) {
debug("Going to change route and DNS to " + this.active.name);
let options = {
cmd: this.active.dhcp ? "runDHCPAndSetDefaultRouteAndDNS" : "setDefaultRouteAndDNS",
cmd: "setDefaultRouteAndDNS",
ifname: this.active.name,
oldIfname: (oldInterface && oldInterface != this.active) ? oldInterface.name : null,
gateway_str: this.active.gateway,

View File

@ -3351,8 +3351,6 @@ RILNetworkInterface.prototype = {
name: null,
dhcp: false,
ip: null,
netmask: null,

View File

@ -250,21 +250,6 @@ function setDefaultRouteAndDNS(options) {
libcutils.property_set("net.dnschange", (parseInt(dnschange, 10) + 1).toString());
}
/**
* Run DHCP and set default route and DNS servers for a given
* network interface.
*/
function runDHCPAndSetDefaultRouteAndDNS(options) {
let dhcp = libnetutils.dhcp_do_request(options.ifname);
dhcp.ifname = options.ifname;
dhcp.oldIfname = options.oldIfname;
//TODO this could be race-y... by the time we've finished the DHCP request
// and are now fudging with the routes, another network interface may have
// come online that's preferred...
setDefaultRouteAndDNS(dhcp);
}
/**
* Remove default route for given network interface.
*/

View File

@ -7,7 +7,7 @@
/**
* Information about networks that is exposed to network manager API consumers.
*/
[scriptable, uuid(d70b9d95-87d5-4ce9-aff7-4323dac79b07)]
[scriptable, uuid(04fe5049-1ea8-4b4f-8c27-d23cd24611bb)]
interface nsINetworkInterface : nsISupports
{
const long NETWORK_STATE_UNKNOWN = -1;
@ -39,11 +39,6 @@ interface nsINetworkInterface : nsISupports
*/
readonly attribute DOMString name;
/**
* Indicates whether DHCP should be run when the interface connects.
*/
readonly attribute boolean dhcp;
/**
* IP Address
*/

View File

@ -1826,10 +1826,6 @@ let WifiNetworkInterface = {
name: null,
// For now we do our own DHCP. In the future this should be handed off
// to the Network Manager.
dhcp: false,
ip: null,
netmask: null,