summaryrefslogtreecommitdiff
path: root/ipacm/src/IPACM_Wlan.cpp
diff options
context:
space:
mode:
authorSkylar Chang <chiaweic@codeaurora.org>2016-09-14 17:50:17 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-29 11:58:11 -0700
commit033aef1dbcfc1b6609b435a165fe00cc5eb6c559 (patch)
tree3820e5b4f49aaf985310a7e0eccc354a0e87550d /ipacm/src/IPACM_Wlan.cpp
parent5f55d12475ea36e622133d16d04fcec243726d97 (diff)
downloadipacfg-mgr-033aef1dbcfc1b6609b435a165fe00cc5eb6c559.tar.gz
IPACM: delete client header when interface goes down
Make sure client headers are always deleted when LAN/WLAN interface without IP address goes down. Change-Id: I770c78fbd693b1e537568da92ab32e6f98005137 Acked-by: Shihuan Liu <shihuanl@qti.qualcomm.com> Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Diffstat (limited to 'ipacm/src/IPACM_Wlan.cpp')
-rw-r--r--ipacm/src/IPACM_Wlan.cpp52
1 files changed, 23 insertions, 29 deletions
diff --git a/ipacm/src/IPACM_Wlan.cpp b/ipacm/src/IPACM_Wlan.cpp
index 00754a1..c067550 100644
--- a/ipacm/src/IPACM_Wlan.cpp
+++ b/ipacm/src/IPACM_Wlan.cpp
@@ -1653,21 +1653,30 @@ int IPACM_Wlan::handle_down_evt()
}
IPACMDBG_H("finished deleting default RT rules\n ");
- /* check software routing fl rule hdl */
- if (softwarerouting_act == true && rx_prop != NULL )
+ eth_bridge_post_event(IPA_ETH_BRIDGE_IFACE_DOWN, IPA_IP_MAX, NULL);
+
+ /* free the wlan clients cache */
+ IPACMDBG_H("Free wlan clients cache\n");
+
+ /* Delete private subnet*/
+#ifdef FEATURE_IPA_ANDROID
+ if (ip_type != IPA_IP_v6)
{
- IPACMDBG_H("Delete sw routing filtering rules\n");
- IPACM_Iface::handle_software_routing_disable();
+ IPACMDBG_H("current IPACM private subnet_addr number(%d)\n", IPACM_Iface::ipacmcfg->ipa_num_private_subnet);
+ IPACMDBG_H(" Delete IPACM private subnet_addr as: 0x%x \n", if_ipv4_subnet);
+ if(IPACM_Iface::ipacmcfg->DelPrivateSubnet(if_ipv4_subnet, ipa_if_num) == false)
+ {
+ IPACMERR(" can't Delete IPACM private subnet_addr as: 0x%x \n", if_ipv4_subnet);
+ }
}
- IPACMDBG_H("finished delete software-routing filtering rules\n ");
-
+ /* reset the IPA-client pipe enum */
+ handle_tethering_client(true, IPACM_CLIENT_WLAN);
+#endif /* defined(FEATURE_IPA_ANDROID)*/
+fail:
/* clean wifi-client header, routing rules */
/* clean wifi client rule*/
IPACMDBG_H("left %d wifi clients need to be deleted \n ", num_wifi_client);
-
- eth_bridge_post_event(IPA_ETH_BRIDGE_IFACE_DOWN, IPA_IP_MAX, NULL);
-
for (i = 0; i < num_wifi_client; i++)
{
/* First reset nat rules and then route rules */
@@ -1681,14 +1690,12 @@ int IPACM_Wlan::handle_down_evt()
{
IPACMERR("unbale to delete v4 default qos route rules for index: %d\n", i);
res = IPACM_FAILURE;
- goto fail;
}
if (delete_default_qos_rtrules(i, IPA_IP_v6))
{
IPACMERR("unbale to delete v6 default qos route rules for index: %d\n", i);
res = IPACM_FAILURE;
- goto fail;
}
IPACMDBG_H("Delete %d client header\n", num_wifi_client);
@@ -1699,7 +1706,6 @@ int IPACM_Wlan::handle_down_evt()
== false)
{
res = IPACM_FAILURE;
- goto fail;
}
}
@@ -1709,30 +1715,18 @@ int IPACM_Wlan::handle_down_evt()
== false)
{
res = IPACM_FAILURE;
- goto fail;
}
}
} /* end of for loop */
- /* free the wlan clients cache */
- IPACMDBG_H("Free wlan clients cache\n");
-
- /* Delete private subnet*/
-#ifdef FEATURE_IPA_ANDROID
- if (ip_type != IPA_IP_v6)
+ /* check software routing fl rule hdl */
+ if (softwarerouting_act == true && rx_prop != NULL )
{
- IPACMDBG_H("current IPACM private subnet_addr number(%d)\n", IPACM_Iface::ipacmcfg->ipa_num_private_subnet);
- IPACMDBG_H(" Delete IPACM private subnet_addr as: 0x%x \n", if_ipv4_subnet);
- if(IPACM_Iface::ipacmcfg->DelPrivateSubnet(if_ipv4_subnet, ipa_if_num) == false)
- {
- IPACMERR(" can't Delete IPACM private subnet_addr as: 0x%x \n", if_ipv4_subnet);
- }
+ IPACMDBG_H("Delete sw routing filtering rules\n");
+ IPACM_Iface::handle_software_routing_disable();
}
- /* reset the IPA-client pipe enum */
- handle_tethering_client(true, IPACM_CLIENT_WLAN);
-#endif /* defined(FEATURE_IPA_ANDROID)*/
+ IPACMDBG_H("finished delete software-routing filtering rules\n ");
-fail:
/* Delete corresponding ipa_rm_resource_name of RX-endpoint after delete all IPV4V6 FT-rule */
if (rx_prop != NULL)
{