Prevent the potential NPE when toggling interface quickly.
Querying interface parameters in different states has race if toggling interface very quickly, for example, remove the interface before transition to ClearingIpAddressState and add it back soon immediately, that will introduce the different interface parameters value. Global member "mInterfaceParams" is null when query occurs in the ClearingIpAddressState since the interface has been removed while local variable "params" isn't, then NPE will be thrown upon retrieving the interface index when attempting to restore MTU. Bug: 162808916 Test: atest NetworkStackIntegrationTests --iterations 100 Change-Id: I346f917aa1ff09342940d3a9a0c468483c279cdb
Loading
Please register or sign in to comment