Skip to content
Commit 704321da authored by chiachangwang's avatar chiachangwang Committed by Chiachang Wang
Browse files

Skip events on stale Ikev2VpnRunner

The exit() of VpnRunner will do exitVpnRunner() and
cleanupVpnStateLocked(). But the exitVpnRunner() posts a runnable
to the executor. This means that disconnectVpnRunner() might run
concurrently with cleanupVpnStateLocked(), and it might even
complete after cleanupVpnStateLocked() finishes. After exiting
the runner, the states are reset. The remaining events in the
executor are irrelavent and should be skipped to prevent
accessing any of the outer class's members.

Also add missing synchronized block by verifying that there is no
other field of the outer Vpn class that is used inside
Ikev2VpnRunner implicitly.

Bug: 235322391
Test: atest FrameworksNetTests
Change-Id: I9eed58b2e96ebaf33e557a42e83525a74a4697d8
Merged-In: I9eed58b2e96ebaf33e557a42e83525a74a4697d8
parent 0e411890
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment