diff options
author | Pooja Kumari <kumarip@codeaurora.org> | 2020-09-24 20:05:32 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2020-10-08 06:25:19 -0700 |
commit | c40430c299f4694692553132086854b03eba3e52 (patch) | |
tree | 1ac31b00140fd5e1c5ccda293fe9f0dd8a0f4381 /ipacm | |
parent | e0ad041f1575b9ff77ebc2ac85e21a8a9084e868 (diff) | |
download | ipacfg-mgr-c40430c299f4694692553132086854b03eba3e52.tar.gz |
ipacm: increment num_tethered_client properly in case of XLAT
Currently in case of XLAT if ADD_DOWNSTREAM event comes
before XLAT_CONNECT event then num_offload_v4_tethered_iface
is not incremented and it will have incorrect value. Increment
num_offload_v4_tethered_iface var if XLAT comes after downstream
is up.
Change-Id: I79814a526b1112d7004fa1959a519475c02fe834
Diffstat (limited to 'ipacm')
-rw-r--r-- | ipacm/src/IPACM_Lan.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/ipacm/src/IPACM_Lan.cpp b/ipacm/src/IPACM_Lan.cpp index 65bd3ca..7e7e875 100644 --- a/ipacm/src/IPACM_Lan.cpp +++ b/ipacm/src/IPACM_Lan.cpp @@ -751,25 +751,7 @@ void IPACM_Lan::event_callback(ipa_cm_event_id event, void *param) if (ipa_interface_index == ipa_if_num) { IPACMDBG_H("Received IPA_DOWNSTREAM_ADD event.\n"); -#ifdef FEATURE_IPA_ANDROID - if (IPACM_Wan::isXlat() && (data->prefix.iptype == IPA_IP_v4)) - { - /* indicate v4-offload */ - IPACM_OffloadManager::num_offload_v4_tethered_iface++; - IPACMDBG_H("in xlat: update num_offload_v4_tethered_iface %d\n", IPACM_OffloadManager::num_offload_v4_tethered_iface); - - /* xlat not support for 2st tethered iface */ - if (IPACM_OffloadManager::num_offload_v4_tethered_iface > 1) - { - IPACMDBG_H("Not support 2st downstream iface %s for xlat, cur: %d\n", dev_name, - IPACM_OffloadManager::num_offload_v4_tethered_iface); - return; - } - } - IPACMDBG_H(" support downstream iface %s, cur %d\n", dev_name, - IPACM_OffloadManager::num_offload_v4_tethered_iface); -#endif if (data->prefix.iptype < IPA_IP_MAX && is_downstream_set[data->prefix.iptype] == false) { IPACMDBG_H("Add downstream for IP iptype %d\n", data->prefix.iptype); @@ -1905,6 +1887,25 @@ int IPACM_Lan::handle_wan_up_ex(ipacm_ext_prop *ext_prop, ipa_ip_type iptype, ui ret = handle_uplink_filter_rule(ext_prop, iptype, xlat_mux_id); modem_ul_v6_set = true; } else if (iptype ==IPA_IP_v4 && modem_ul_v4_set == false) { +#ifdef FEATURE_IPA_ANDROID + if (IPACM_Wan::isXlat()) + { + /* indicate v4-offload */ + IPACM_OffloadManager::num_offload_v4_tethered_iface++; + IPACMDBG_H("in xlat: update num_offload_v4_tethered_iface %d\n", IPACM_OffloadManager::num_offload_v4_tethered_iface); + + /* xlat not support for 2st tethered iface */ + if (IPACM_OffloadManager::num_offload_v4_tethered_iface > 1) + { + IPACMDBG_H("Not support 2st downstream iface %s for xlat, cur: %d\n", dev_name, + IPACM_OffloadManager::num_offload_v4_tethered_iface); + return IPACM_FAILURE; + } + } + + IPACMDBG_H(" support downstream iface %s, cur %d\n", dev_name, + IPACM_OffloadManager::num_offload_v4_tethered_iface); +#endif /* add MTU rules for ipv4 */ handle_private_subnet_android(IPA_IP_v4); |