OSDN Git Service

Track IP addresses in WifiStateMachine.
authorLorenzo Colitti <lorenzo@google.com>
Thu, 8 Aug 2013 10:38:37 +0000 (19:38 +0900)
committerLorenzo Colitti <lorenzo@google.com>
Thu, 5 Sep 2013 23:21:23 +0000 (08:21 +0900)
commit34b2b9b6db7d57993bd71c2b62191c1fc533ebff
tree6976da68a4aaa199ab24fdc3aef2a0cb8918dbdb
parent22f407b11e11cfdb336e06e8c0d4a7ef1eafc783
Track IP addresses in WifiStateMachine.

This makes WifiStateMachine listen for interface address
changes. When an address changes, WifiStateMachine will update
its LinkProperties to match reality and notify the system that
the link configuration has changed. This allows wifi to keep
track of IPv6 addresses as well (previously it only knew about
the IPv4 address passed in by DHCP).

IP addresses are obtained directly from the kernel and always
match those configured on the interface, so we treat them as
authoritative and ignore addresses passed in via DHCP (by the
time DHCP passes them in we've already been notified by the
kernel anyway).

Since we now have multiple sources of link information (the
kernel for addresses and DHCP for routes and DNS, plus various
bits of static information), also move all the code that sets
mLinkProperties into one place. This allows us to be clearer
about who is authoritative for which parts of mLinkProperties.

Bug: 10232006
Change-Id: I4f262342379ce7fed172b67a1d403e3cd34f4232
wifi/java/android/net/wifi/WifiStateMachine.java