summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammed Javid <mjavid@codeaurora.org>2018-04-19 17:53:17 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-05-07 00:06:03 -0700
commitffa492de0a9a7342218ee77a189b2e644f8cbeb3 (patch)
tree48e432d92d1305a6692169c6fb69e8587191d0dd
parentb572adf65522c587964bacbc1c4623212d8040fd (diff)
ipacm:clear event cache if ipacm receives stopOffload
Currently if NAT iface is not added, IPACM cache setupstream events but default gw index will be set only after adding NAT iface. If IPACM receives stopOffload in between, then it is returning input check error to framework. Add check and clear event cache in case of stopOffload. Change-Id: I1e49a37bfba64458f8966c9894bf48f749f0bbd7
-rw-r--r--ipacm/src/IPACM_OffloadManager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/ipacm/src/IPACM_OffloadManager.cpp b/ipacm/src/IPACM_OffloadManager.cpp
index c9d450f..2ee48d3 100644
--- a/ipacm/src/IPACM_OffloadManager.cpp
+++ b/ipacm/src/IPACM_OffloadManager.cpp
@@ -363,6 +363,14 @@ RET IPACM_OffloadManager::setUpstream(const char *upstream_name, const Prefix& g
if(upstream_name == NULL)
{
if (default_gw_index == INVALID_IFACE) {
+ for (index = 0; index < MAX_EVENT_CACHE; index++) {
+ if (event_cache[index].valid == true &&
+ event_cache[index ].event == IPA_WAN_UPSTREAM_ROUTE_ADD_EVENT) {
+ event_cache[index].valid = false;
+ memset(event_cache, 0, MAX_EVENT_CACHE*sizeof(framework_event_cache));
+ return SUCCESS;
+ }
+ }
IPACMERR("no previous upstream set before\n");
return FAIL_INPUT_CHECK;
}