Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7dc8ef83 authored by Xiao Ma's avatar Xiao Ma
Browse files

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
parent e639bf3b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment