diff options
author | Skylar Chang <chiaweic@codeaurora.org> | 2017-09-26 11:48:59 -0700 |
---|---|---|
committer | Skylar Chang <chiaweic@codeaurora.org> | 2017-10-02 10:48:41 -0700 |
commit | e365ac299b28d35eea7baa01b9484fd5cb49e015 (patch) | |
tree | b312c564616ab64ea7c2382b00d76f6843dcc6ae /ipacm | |
parent | 05a81cd99c1a4167c0c25af548d25e01cd7f7445 (diff) | |
download | ipacfg-mgr-e365ac299b28d35eea7baa01b9484fd5cb49e015.tar.gz |
ipacm: fix the VTS error
On VTS IPACM_HAL unit-test, since wlan
tethering devive won't up, therefore the
addDownsream events are all cached in
IPACM_HAL and keep accumulated until
reaching IPACM's max cached and seeing
test-case starts failing. The fix is
to clean up the cache on Stopoffload.
Bug: 65612227
Change-Id: I24f410f5c5ae3a6cad0e14293f266b067f643389
Diffstat (limited to 'ipacm')
-rw-r--r-- | ipacm/src/IPACM_OffloadManager.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ipacm/src/IPACM_OffloadManager.cpp b/ipacm/src/IPACM_OffloadManager.cpp index c923e2d..762b56d 100644 --- a/ipacm/src/IPACM_OffloadManager.cpp +++ b/ipacm/src/IPACM_OffloadManager.cpp @@ -477,12 +477,22 @@ RET IPACM_OffloadManager::setUpstream(const char *upstream_name, const Prefix& g RET IPACM_OffloadManager::stopAllOffload() { Prefix v4gw, v6gw; + RET result = SUCCESS; + memset(&v4gw, 0, sizeof(v4gw)); memset(&v6gw, 0, sizeof(v6gw)); v4gw.fam = V4; v6gw.fam = V6; IPACMDBG_H("posting setUpstream(NULL), ipv4-fam(%d) ipv6-fam(%d)\n", v4gw.fam, v6gw.fam); - return setUpstream(NULL, v4gw, v6gw); + result = setUpstream(NULL, v4gw, v6gw); + + /* reset the event cache */ + default_gw_index = INVALID_IFACE; + upstream_v4_up = false; + upstream_v6_up = false; + memset(event_cache, 0, MAX_EVENT_CACHE*sizeof(framework_event_cache)); + latest_cache_index = 0; + return result; } RET IPACM_OffloadManager::setQuota(const char * upstream_name /* upstream */, uint64_t mb/* limit */) |