Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3350)

Unified Diff: chrome/browser/chromeos/cros/network_library.cc

Issue 7101013: Fix issue with static ipconfig not creating dhcp ip configs properly. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/options/chromeos/internet_detail.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/cros/network_library.cc
===================================================================
--- chrome/browser/chromeos/cros/network_library.cc (revision 87321)
+++ chrome/browser/chromeos/cros/network_library.cc (working copy)
@@ -3388,28 +3388,30 @@
}
}
- // If switching from dhcp to static, then create new static ip config.
IPConfigStatus* ipconfig_status2 = NULL;
- if (ipconfig.type == chromeos::IPCONFIG_TYPE_IPV4 && !ipconfig_static) {
- // Create new static ip config.
- chromeos::AddIPConfig(ipconfig.device_path.c_str(),
- chromeos::IPCONFIG_TYPE_IPV4);
- // Now find the newly created IP config.
- ipconfig_status2 = chromeos::ListIPConfigs(ipconfig.device_path.c_str());
- if (ipconfig_status2) {
- for (int i = 0; i < ipconfig_status2->size; i++) {
- if (ipconfig_status2->ips[i].type == chromeos::IPCONFIG_TYPE_IPV4)
- ipconfig_static = &ipconfig_status2->ips[i];
- }
- }
- }
-
if (ipconfig.type == chromeos::IPCONFIG_TYPE_DHCP) {
- if (ipconfig_static) {
- // User wants DHCP now. So delete the static ip config.
+ // If switching from static to dhcp, create new dhcp ip config.
+ if (!ipconfig_dhcp)
+ chromeos::AddIPConfig(ipconfig.device_path.c_str(),
+ chromeos::IPCONFIG_TYPE_DHCP);
+ // User wants DHCP now. So delete the static ip config.
+ if (ipconfig_static)
chromeos::RemoveIPConfig(ipconfig_static);
+ } else if (ipconfig.type == chromeos::IPCONFIG_TYPE_IPV4) {
+ // If switching from dhcp to static, create new static ip config.
+ if (!ipconfig_static) {
+ chromeos::AddIPConfig(ipconfig.device_path.c_str(),
+ chromeos::IPCONFIG_TYPE_IPV4);
+ // Now find the newly created IP config.
+ ipconfig_status2 =
+ chromeos::ListIPConfigs(ipconfig.device_path.c_str());
+ if (ipconfig_status2) {
+ for (int i = 0; i < ipconfig_status2->size; i++) {
+ if (ipconfig_status2->ips[i].type == chromeos::IPCONFIG_TYPE_IPV4)
+ ipconfig_static = &ipconfig_status2->ips[i];
+ }
+ }
}
- } else if (ipconfig.type == chromeos::IPCONFIG_TYPE_IPV4) {
if (ipconfig_static) {
// Save any changed details.
if (ipconfig.address != ipconfig_static->address) {
@@ -3444,9 +3446,8 @@
value.get());
}
// Remove dhcp ip config if there is one.
- if (ipconfig_dhcp) {
+ if (ipconfig_dhcp)
chromeos::RemoveIPConfig(ipconfig_dhcp);
- }
}
}
« no previous file with comments | « no previous file | chrome/browser/resources/options/chromeos/internet_detail.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698