summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2013-04-08 18:02:02 -0700
committerRobert Greenwalt <rgreenwalt@google.com>2013-04-08 18:02:02 -0700
commit4b8fabd5a87828d676b1f9547fdaedcaeac39c6a (patch)
treebcf7564e0fd9f8d77db0aee7861e4f4f358e8fcb /wifi
parentc4ad3cb07ed76c5697c60285456d9c49675174d9 (diff)
downloadframeworks_base-4b8fabd5a87828d676b1f9547fdaedcaeac39c6a.zip
frameworks_base-4b8fabd5a87828d676b1f9547fdaedcaeac39c6a.tar.gz
frameworks_base-4b8fabd5a87828d676b1f9547fdaedcaeac39c6a.tar.bz2
Fix crash bug with mismatched iface names
The copied-to LinkProperties needs the same iface name as the copied from. Since we were copying into an empty LP this was trivial, but I changed the params to tighten up this contract - don't want to accidentally change an LP's iface name when we shouldn't. bug:8569797 Change-Id: I5f88826e37271a0549c14d004bb2f16983b950e6
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/android/net/wifi/WifiConfigStore.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfigStore.java b/wifi/java/android/net/wifi/WifiConfigStore.java
index 47f1fbf..7b1a71f 100644
--- a/wifi/java/android/net/wifi/WifiConfigStore.java
+++ b/wifi/java/android/net/wifi/WifiConfigStore.java
@@ -1196,7 +1196,7 @@ class WifiConfigStore {
WifiConfiguration newConfig) {
boolean ipChanged = false;
boolean proxyChanged = false;
- LinkProperties linkProperties = new LinkProperties();
+ LinkProperties linkProperties = null;
switch (newConfig.ipAssignment) {
case STATIC:
@@ -1262,10 +1262,10 @@ class WifiConfigStore {
}
if (!ipChanged) {
- addIpSettingsFromConfig(linkProperties, currentConfig);
+ linkProperties = copyIpSettingsFromConfig(currentConfig);
} else {
currentConfig.ipAssignment = newConfig.ipAssignment;
- addIpSettingsFromConfig(linkProperties, newConfig);
+ linkProperties = copyIpSettingsFromConfig(newConfig);
log("IP config changed SSID = " + currentConfig.SSID + " linkProperties: " +
linkProperties.toString());
}
@@ -1291,8 +1291,9 @@ class WifiConfigStore {
return new NetworkUpdateResult(ipChanged, proxyChanged);
}
- private void addIpSettingsFromConfig(LinkProperties linkProperties,
- WifiConfiguration config) {
+ private LinkProperties copyIpSettingsFromConfig(WifiConfiguration config) {
+ LinkProperties linkProperties = new LinkProperties();
+ linkProperties.setInterfaceName(config.linkProperties.getInterfaceName());
for (LinkAddress linkAddr : config.linkProperties.getLinkAddresses()) {
linkProperties.addLinkAddress(linkAddr);
}
@@ -1302,6 +1303,7 @@ class WifiConfigStore {
for (InetAddress dns : config.linkProperties.getDnses()) {
linkProperties.addDns(dns);
}
+ return linkProperties;
}
/**