diff options
author | Daniel Mentz <danielmentz@google.com> | 2018-03-27 03:22:45 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-03-27 03:22:45 +0000 |
commit | ecac40300066b9bc4734620388024484ba43ab73 (patch) | |
tree | 3d7e760fcc8f9c203eebccd75fce92c01d6d1460 | |
parent | 5a18acec78edabebd69ada2faaaa410f5e9ddf8a (diff) | |
parent | d45eea13b0d077bcebffbc0222b31d529e3c03c9 (diff) | |
download | ipacfg-mgr-ecac40300066b9bc4734620388024484ba43ab73.tar.gz |
Merge remote-tracking branch 'goog/qcom/release/LA.UM.7.3.9.08.00.00.385.203' into pi-dev am: e4f0f62b42
am: d45eea13b0
Change-Id: I5bcc867f9cd2ddf8bb1a6c77f5f680a021cd4eb6
-rw-r--r-- | ipacm/src/IPACM_CmdQueue.cpp | 13 | ||||
-rw-r--r-- | ipacm/src/IPACM_ConntrackClient.cpp | 6 | ||||
-rw-r--r-- | ipacm/src/IPACM_ConntrackListener.cpp | 73 | ||||
-rw-r--r-- | ipacm/src/IPACM_Conntrack_NATApp.cpp | 23 | ||||
-rw-r--r-- | ipacm/src/IPACM_EvtDispatcher.cpp | 6 | ||||
-rw-r--r-- | ipacm/src/IPACM_Filtering.cpp | 24 | ||||
-rw-r--r-- | ipacm/src/IPACM_Lan.cpp | 68 | ||||
-rw-r--r-- | ipacm/src/IPACM_OffloadManager.cpp | 11 | ||||
-rw-r--r-- | ipacm/src/IPACM_Wan.cpp | 65 | ||||
-rw-r--r-- | ipacm/src/IPACM_Wlan.cpp | 12 |
10 files changed, 225 insertions, 76 deletions
diff --git a/ipacm/src/IPACM_CmdQueue.cpp b/ipacm/src/IPACM_CmdQueue.cpp index c612b7f..3a2d470 100644 --- a/ipacm/src/IPACM_CmdQueue.cpp +++ b/ipacm/src/IPACM_CmdQueue.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. +Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -123,6 +123,7 @@ void* MessageQueue::Process(void *param) MessageQueue *MsgQueueExternal = NULL; Message *item = NULL; param = NULL; + const char *eventName = NULL; IPACMDBG("MessageQueue::Process()\n"); @@ -160,8 +161,12 @@ void* MessageQueue::Process(void *param) } else { - IPACMDBG("Get event %s from internal queue.\n", - IPACM_Iface::ipacmcfg->getEventName(item->evt.data.event)); + eventName = IPACM_Iface::ipacmcfg->getEventName(item->evt.data.event); + if (eventName != NULL) + { + IPACMDBG("Get event %s from internal queue.\n", + eventName); + } } if(item == NULL) @@ -196,7 +201,7 @@ void* MessageQueue::Process(void *param) return NULL; } - IPACMDBG("Processing item %p event ID: %d\n",item,item->evt.data.event); + IPACMDBG("Processing item %pK event ID: %d\n",item,item->evt.data.event); item->evt.callback_ptr(&item->evt.data); delete item; item = NULL; diff --git a/ipacm/src/IPACM_ConntrackClient.cpp b/ipacm/src/IPACM_ConntrackClient.cpp index 3eab6fa..8a2499c 100644 --- a/ipacm/src/IPACM_ConntrackClient.cpp +++ b/ipacm/src/IPACM_ConntrackClient.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. +Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -177,8 +177,6 @@ int IPACM_ConntrackClient::IPA_Conntrack_Filters_Ignore_Bridge_Addrs /* retrieve bridge interface ipv4 address */ memset(&ifr, 0, sizeof(struct ifreq)); ifr.ifr_addr.sa_family = AF_INET; - (void)strlcpy(ifr.ifr_name, IPACM_Iface::ipacmcfg->ipa_virtual_iface_name, sizeof(ifr.ifr_name)); - IPACMDBG("bridge interface name (%s)\n", ifr.ifr_name); if(strlen(IPACM_Iface::ipacmcfg->ipa_virtual_iface_name) >= sizeof(ifr.ifr_name)) { @@ -187,6 +185,8 @@ int IPACM_ConntrackClient::IPA_Conntrack_Filters_Ignore_Bridge_Addrs close(fd); return -1; } + (void)strlcpy(ifr.ifr_name, IPACM_Iface::ipacmcfg->ipa_virtual_iface_name, sizeof(ifr.ifr_name)); + IPACMDBG("bridge interface name (%s)\n", ifr.ifr_name); ret = ioctl(fd, SIOCGIFADDR, &ifr); if (ret < 0) diff --git a/ipacm/src/IPACM_ConntrackListener.cpp b/ipacm/src/IPACM_ConntrackListener.cpp index 4a0c1c1..29a70b9 100644 --- a/ipacm/src/IPACM_ConntrackListener.cpp +++ b/ipacm/src/IPACM_ConntrackListener.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. +Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -1037,9 +1037,9 @@ void IPACM_ConntrackListener::ProcessTCPorUDPMsg( nat_entry.ct = ct; nat_entry.type = type; - memset(&rule, 0, sizeof(rule)); - IPACMDBG("Received type:%d with proto:%d\n", type, l4proto); - status = nfct_get_attr_u32(ct, ATTR_STATUS); + memset(&rule, 0, sizeof(rule)); + IPACMDBG("Received type:%d with proto:%d\n", type, l4proto); + status = nfct_get_attr_u32(ct, ATTR_STATUS); /* Retrieve Protocol */ rule.protocol = nfct_get_attr_u8(ct, ATTR_REPL_L4PROTO); @@ -1089,47 +1089,40 @@ void IPACM_ConntrackListener::ProcessTCPorUDPMsg( #ifdef CT_OPT HandleLan2Lan(ct, type, &rule); #endif - return; + IPACMDBG("Neither source Nor destination nat\n"); + goto IGNORE; } - } + } - if(IPS_DST_NAT == status || IPS_SRC_NAT == status) - { - PopulateTCPorUDPEntry(ct, status, &rule); - rule.public_ip = wan_ipaddr; - } - else - { - IPACMDBG("Neither source Nor destination nat\n"); - goto IGNORE; - } + PopulateTCPorUDPEntry(ct, status, &rule); + rule.public_ip = wan_ipaddr; - if (rule.private_ip != wan_ipaddr) - { - isAdd = AddIface(&rule, &nat_entry.isTempEntry); - if (!isAdd) - { - goto IGNORE; - } - } - else - { - if (isStaMode) - { - IPACMDBG("In STA mode, ignore connections destinated to STA interface\n"); - goto IGNORE; - } + if (rule.private_ip != wan_ipaddr) + { + isAdd = AddIface(&rule, &nat_entry.isTempEntry); + if (!isAdd) + { + goto IGNORE; + } + } + else + { + if (isStaMode) + { + IPACMDBG("In STA mode, ignore connections destinated to STA interface\n"); + goto IGNORE; + } - IPACMDBG("For embedded connections add dummy nat rule\n"); - IPACMDBG("Change private port %d to %d\n", - rule.private_port, rule.public_port); - rule.private_port = rule.public_port; - } + IPACMDBG("For embedded connections add dummy nat rule\n"); + IPACMDBG("Change private port %d to %d\n", + rule.private_port, rule.public_port); + rule.private_port = rule.public_port; + } - CheckSTAClient(&rule, &nat_entry.isTempEntry); - nat_entry.rule = &rule; - AddORDeleteNatEntry(&nat_entry); - return; + CheckSTAClient(&rule, &nat_entry.isTempEntry); + nat_entry.rule = &rule; + AddORDeleteNatEntry(&nat_entry); + return; IGNORE: IPACMDBG_H("ignoring below Nat Entry\n"); diff --git a/ipacm/src/IPACM_Conntrack_NATApp.cpp b/ipacm/src/IPACM_Conntrack_NATApp.cpp index 27bf95a..4004597 100644 --- a/ipacm/src/IPACM_Conntrack_NATApp.cpp +++ b/ipacm/src/IPACM_Conntrack_NATApp.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. +Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -94,11 +94,7 @@ int NatApp::Init(void) } memset(pALGPorts, 0, sizeof(ipacm_alg) * nALGPort); - if(pConfig->GetAlgPorts(nALGPort, pALGPorts) != 0) - { - IPACMERR("Unable to retrieve ALG prots\n"); - goto fail; - } + pConfig->GetAlgPorts(nALGPort, pALGPorts); IPACMDBG("Printing %d alg ports information\n", nALGPort); for(int cnt=0; cnt<nALGPort; cnt++) @@ -106,12 +102,23 @@ int NatApp::Init(void) IPACMDBG("%d: Proto[%d], port[%d]\n", cnt, pALGPorts[cnt].protocol, pALGPorts[cnt].port); } } + else + { + IPACMERR("Unable to retrieve ALG prot count\n"); + goto fail; + } return 0; fail: - free(cache); - free(pALGPorts); + if(cache != NULL) + { + free(cache); + } + if(pALGPorts != NULL) + { + free(pALGPorts); + } return -1; } diff --git a/ipacm/src/IPACM_EvtDispatcher.cpp b/ipacm/src/IPACM_EvtDispatcher.cpp index edb5901..2914f66 100644 --- a/ipacm/src/IPACM_EvtDispatcher.cpp +++ b/ipacm/src/IPACM_EvtDispatcher.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. +Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -92,7 +92,7 @@ int IPACM_EvtDispatcher::PostEvt IPACMDBG("Enqueing item\n"); MsgQueue->enqueue(item); - IPACMDBG("Enqueued item %p\n", item); + IPACMDBG("Enqueued item %pK\n", item); if(pthread_cond_signal(&cond_var) != 0) { @@ -141,7 +141,7 @@ void IPACM_EvtDispatcher::ProcessEvt(ipacm_cmd_q_data *data) if(data->evt_data != NULL) { - IPACMDBG("free the event:%d data: %p\n", data->event, data->evt_data); + IPACMDBG("free the event:%d data: %pK\n", data->event, data->evt_data); free(data->evt_data); } return; diff --git a/ipacm/src/IPACM_Filtering.cpp b/ipacm/src/IPACM_Filtering.cpp index 411fe90..3545d81 100644 --- a/ipacm/src/IPACM_Filtering.cpp +++ b/ipacm/src/IPACM_Filtering.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. +Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -87,7 +87,7 @@ bool IPACM_Filtering::AddFilteringRule(struct ipa_ioc_add_flt_rule const *ruleTa retval = ioctl(fd, IPA_IOC_ADD_FLT_RULE, ruleTable); if (retval != 0) { - IPACMERR("Failed adding Filtering rule %p\n", ruleTable); + IPACMERR("Failed adding Filtering rule %pK\n", ruleTable); PERROR("unable to add filter rule:"); for (int cnt = 0; cnt < ruleTable->num_rules; cnt++) @@ -110,7 +110,7 @@ bool IPACM_Filtering::AddFilteringRule(struct ipa_ioc_add_flt_rule const *ruleTa } } - IPACMDBG("Added Filtering rule %p\n", ruleTable); + IPACMDBG("Added Filtering rule %pK\n", ruleTable); return true; } @@ -138,13 +138,13 @@ bool IPACM_Filtering::AddFilteringRuleAfter(struct ipa_ioc_add_flt_rule_after co if (retval != 0) { - IPACMERR("Failed adding Filtering rule %p\n", ruleTable); + IPACMERR("Failed adding Filtering rule %pK\n", ruleTable); return false; } - IPACMDBG("Added Filtering rule %p\n", ruleTable); + IPACMDBG("Added Filtering rule %pK\n", ruleTable); #else if (ruleTable) - IPACMERR("Not support adding Filtering rule %p\n", ruleTable); + IPACMERR("Not support adding Filtering rule %pK\n", ruleTable); #endif return true; } @@ -156,11 +156,11 @@ bool IPACM_Filtering::DeleteFilteringRule(struct ipa_ioc_del_flt_rule *ruleTable retval = ioctl(fd, IPA_IOC_DEL_FLT_RULE, ruleTable); if (retval != 0) { - IPACMERR("Failed deleting Filtering rule %p\n", ruleTable); + IPACMERR("Failed deleting Filtering rule %pK\n", ruleTable); return false; } - IPACMDBG("Deleted Filtering rule %p\n", ruleTable); + IPACMDBG("Deleted Filtering rule %pK\n", ruleTable); return true; } @@ -450,7 +450,7 @@ bool IPACM_Filtering::AddWanDLFilteringRule(struct ipa_ioc_add_flt_rule const *r ret = ioctl(fd_wwan_ioctl, WAN_IOC_ADD_FLT_RULE_EX, &qmi_rule_ex_msg); if (ret != 0) { - IPACMERR("Failed adding Filtering rule %p with ret %d\n ", &qmi_rule_ex_msg, ret); + IPACMERR("Failed adding Filtering rule %pK with ret %d\n ", &qmi_rule_ex_msg, ret); close(fd_wwan_ioctl); return false; } @@ -474,12 +474,12 @@ bool IPACM_Filtering::SendFilteringRuleIndex(struct ipa_fltr_installed_notif_req ret = ioctl(fd_wwan_ioctl, WAN_IOC_ADD_FLT_RULE_INDEX, table); if (ret != 0) { - IPACMERR("Failed adding filtering rule index %p with ret %d\n", table, ret); + IPACMERR("Failed adding filtering rule index %pK with ret %d\n", table, ret); close(fd_wwan_ioctl); return false; } - IPACMDBG("Added Filtering rule index %p\n", table); + IPACMDBG("Added Filtering rule index %pK\n", table); close(fd_wwan_ioctl); return true; } @@ -520,7 +520,7 @@ bool IPACM_Filtering::ModifyFilteringRule(struct ipa_ioc_mdfy_flt_rule* ruleTabl ret = ioctl(fd, IPA_IOC_MDFY_FLT_RULE, ruleTable); if (ret != 0) { - IPACMERR("Failed modifying filtering rule %p\n", ruleTable); + IPACMERR("Failed modifying filtering rule %pK\n", ruleTable); for (i = 0; i < ruleTable->num_rules; i++) { diff --git a/ipacm/src/IPACM_Lan.cpp b/ipacm/src/IPACM_Lan.cpp index a1d2ab6..f7544e8 100644 --- a/ipacm/src/IPACM_Lan.cpp +++ b/ipacm/src/IPACM_Lan.cpp @@ -193,6 +193,14 @@ IPACM_Lan::IPACM_Lan(int iface_index) : IPACM_Iface(iface_index) memset(&prefix, 0, sizeof(prefix)); #ifdef FEATURE_IPACM_HAL + + /* check if Upstream was set before as WIFI with RNDIS case */ + if(ipa_if_cate == LAN_IF && IPACM_Wan::backhaul_is_sta_mode == true) /* LTE */ + { + IPACMDBG_H(" Skip the Upstream falg set on LAN instance (%d) with WIFI backhaul (%d)\n", ipa_if_cate, IPACM_Wan::backhaul_is_sta_mode ); /* RNDIS+WIFI not support on msm*/ + return; + } + /* check if Upstream was set before */ if (IPACM_Wan::isWanUP(ipa_if_num)) { @@ -227,6 +235,7 @@ void IPACM_Lan::event_callback(ipa_cm_event_id event, void *param) } int ipa_interface_index; + uint32_t i; ipacm_ext_prop* ext_prop; ipacm_event_iface_up_tehter* data_wan_tether; @@ -453,6 +462,18 @@ void IPACM_Lan::event_callback(ipa_cm_event_id event, void *param) } else { IPACMDBG_H("Wan_V6 haven't up yet\n"); } +#else + /* check if Upstream was set before */ + if (IPACM_Wan::isWanUP(ipa_if_num)) + { + IPACMDBG_H("Upstream was set previously for ipv4, change is_upstream_set flag\n"); + is_upstream_set[IPA_IP_v4] = true; + } + if (IPACM_Wan::isWanUP_V6(ipa_if_num)) + { + IPACMDBG_H("Upstream was set previously for ipv6, change is_upstream_set flag\n"); + is_upstream_set[IPA_IP_v6] = true; + } #endif /* Post event to NAT */ if (data->iptype == IPA_IP_v4) @@ -516,6 +537,45 @@ void IPACM_Lan::event_callback(ipa_cm_event_id event, void *param) IPACMERR("IPA_HANDLE_WAN_UP_TETHER tether_if(%d), not valid (%d) ignore\n", data_wan_tether->if_index_tether, ipa_if_num); return; } +#else /* not offload rndis on WIFI mode on MSM targets sky*/ + if (data_wan_tether->is_sta) + { + IPACMERR("Not support RNDIS offload on WIFI mode, dun install UL filter rules for WIFI mode\n"); + + /* clean rndis header, routing rules */ + IPACMDBG_H("left %d eth clients need to be deleted \n ", num_eth_client); + for (i = 0; i < num_eth_client; i++) + { + /* First reset nat rules and then route rules */ + if(get_client_memptr(eth_client, i)->ipv4_set == true) + { + IPACMDBG_H("Clean Nat Rules for ipv4:0x%x\n", get_client_memptr(eth_client, i)->v4_addr); + CtList->HandleNeighIpAddrDelEvt(get_client_memptr(eth_client, i)->v4_addr); + } + if (delete_eth_rtrules(i, IPA_IP_v4)) + IPACMERR("unbale to delete usb-client v4 route rules for index %d\n", i); + + if (delete_eth_rtrules(i, IPA_IP_v6)) + IPACMERR("unbale to delete ecm-client v6 route rules for index %d\n", i); + + IPACMDBG_H("Delete %d client header\n", num_eth_client); + + if(get_client_memptr(eth_client, i)->ipv4_header_set == true) + { + if (m_header.DeleteHeaderHdl(get_client_memptr(eth_client, i)->hdr_hdl_v4) + == false) + IPACMERR("unbale to delete usb-client v4 header for index %d\n", i); + } + + if(get_client_memptr(eth_client, i)->ipv6_header_set == true) + { + if (m_header.DeleteHeaderHdl(get_client_memptr(eth_client, i)->hdr_hdl_v6) + == false) + IPACMERR("unbale to delete usb-client v6 header for index %d\n", i); + } + } /* end of for loop */ + return; + } #endif if (ip_type == IPA_IP_v4 || ip_type == IPA_IP_MAX) { @@ -847,6 +907,14 @@ void IPACM_Lan::event_callback(ipa_cm_event_id event, void *param) IPACMDBG_H("Recieved IPA_NEIGH_CLIENT_IP_ADDR_ADD_EVENT event \n"); IPACMDBG_H("check iface %s category: %d\n", dev_name, ipa_if_cate); + /* if RNDIS under WIFI mode in MSM, dun add RT rule*/ +#ifdef FEATURE_IPACM_HAL + if(IPACM_Wan::backhaul_is_sta_mode == true) /* WIFI */ + { + IPACMDBG_H(" dun construct header and RT-rules for RNDIS-PC in WIFI mode on MSM targets (STA %d) \n", IPACM_Wan::backhaul_is_sta_mode); + return; + } +#endif if (ipa_interface_index == ipa_if_num && ipa_if_cate == ODU_IF) { IPACMDBG_H("ODU iface got v4-ip \n"); diff --git a/ipacm/src/IPACM_OffloadManager.cpp b/ipacm/src/IPACM_OffloadManager.cpp index a42f919..85ef7e4 100644 --- a/ipacm/src/IPACM_OffloadManager.cpp +++ b/ipacm/src/IPACM_OffloadManager.cpp @@ -442,6 +442,17 @@ RET IPACM_OffloadManager::setUpstream(const char *upstream_name, const Prefix& g /* reset the stats when switch from LTE->STA */ if (index != default_gw_index) { IPACMDBG_H(" interface switched to %s\n", upstream_name); + if (upstream_v4_up == true) { + IPACMDBG_H("clean upstream for ipv4-fam(%d) upstream_v4_up(%d)\n", gw_addr_v4.fam, upstream_v4_up); + post_route_evt(IPA_IP_v4, default_gw_index, IPA_WAN_UPSTREAM_ROUTE_DEL_EVENT, gw_addr_v4); + upstream_v4_up = false; + } + if (upstream_v6_up == true) { + IPACMDBG_H("clean upstream for ipv6-fam(%d) upstream_v6_up(%d)\n", gw_addr_v6.fam, upstream_v6_up); + post_route_evt(IPA_IP_v6, default_gw_index, IPA_WAN_UPSTREAM_ROUTE_DEL_EVENT, gw_addr_v6); + upstream_v6_up = false; + } + default_gw_index = INVALID_IFACE; if(memcmp(upstream_name, "wlan0", sizeof("wlan0")) == 0) { IPACMDBG_H("switch to STA mode, need reset wlan-fw stats\n"); diff --git a/ipacm/src/IPACM_Wan.cpp b/ipacm/src/IPACM_Wan.cpp index 87ecb6d..a902457 100644 --- a/ipacm/src/IPACM_Wan.cpp +++ b/ipacm/src/IPACM_Wan.cpp @@ -4375,7 +4375,11 @@ int IPACM_Wan::config_dft_embms_rules(ipa_ioc_add_flt_rule *pFilteringTable_v4, int IPACM_Wan::handle_down_evt() { int res = IPACM_SUCCESS; - uint32_t i; + uint32_t i, tether_total; + int ipa_if_num_tether_tmp[IPA_MAX_IFACE_ENTRIES]; + + tether_total = 0; + memset(ipa_if_num_tether_tmp, 0, IPA_MAX_IFACE_ENTRIES); IPACMDBG_H(" wan handle_down_evt \n"); @@ -4396,22 +4400,61 @@ int IPACM_Wan::handle_down_evt() /* make sure default routing rules and firewall rules are deleted*/ if (active_v4) { - if (rx_prop != NULL) - { + if (rx_prop != NULL) + { del_dft_firewall_rules(IPA_IP_v4); } handle_route_del_evt(IPA_IP_v4); IPACMDBG_H("Delete default v4 routing rules\n"); + +#ifdef FEATURE_IPA_ANDROID + /* posting wan_down_tether for lan clients */ +#ifdef FEATURE_IPACM_HAL + IPACMDBG_H("Posting IPA_WAN_DOWN_TETHER_EVENT for IPV4\n"); + post_wan_down_tether_evt(IPA_IP_v4, 0); +#else + for (i=0; i < IPACM_Wan::ipa_if_num_tether_v4_total; i++) + { + ipa_if_num_tether_tmp[i] = IPACM_Wan::ipa_if_num_tether_v4[i]; + } + tether_total = IPACM_Wan::ipa_if_num_tether_v4_total; + for (i=0; i < tether_total; i++) + { + post_wan_down_tether_evt(IPA_IP_v4, ipa_if_num_tether_tmp[i]); + IPACMDBG_H("post_wan_down_tether_v4 iface(%d: %s)\n", + i, IPACM_Iface::ipacmcfg->iface_table[ipa_if_num_tether_tmp[i]].iface_name); + } +#endif +#endif } if (active_v6) { - if (rx_prop != NULL) - { + if (rx_prop != NULL) + { del_dft_firewall_rules(IPA_IP_v6); } handle_route_del_evt(IPA_IP_v6); IPACMDBG_H("Delete default v6 routing rules\n"); +#ifdef FEATURE_IPA_ANDROID + /* posting wan_down_tether for lan clients */ +#ifdef FEATURE_IPACM_HAL + IPACMDBG_H("Posting IPA_WAN_DOWN_TETHER_EVENT for IPV6\n"); + post_wan_down_tether_evt(IPA_IP_v6, 0); +#else + for (i=0; i < IPACM_Wan::ipa_if_num_tether_v6_total; i++) + { + ipa_if_num_tether_tmp[i] = IPACM_Wan::ipa_if_num_tether_v6[i]; + } + tether_total = IPACM_Wan::ipa_if_num_tether_v6_total; + for (i=0; i < tether_total; i++) + { + post_wan_down_tether_evt(IPA_IP_v6, ipa_if_num_tether_tmp[i]); + IPACMDBG_H("post_wan_down_tether_v6 iface(%d: %s)\n", + i, IPACM_Iface::ipacmcfg->iface_table[ipa_if_num_tether_tmp[i]].iface_name); + } +#endif +#endif } /* Delete default v4 RT rule */ @@ -4420,7 +4463,7 @@ int IPACM_Wan::handle_down_evt() IPACMDBG_H("Delete default v4 routing rules\n"); if (m_routing.DeleteRoutingHdl(dft_rt_rule_hdl[0], IPA_IP_v4) == false) { - IPACMERR("Routing rule deletion failed!\n"); + IPACMERR("Routing rule deletion failed!\n"); res = IPACM_FAILURE; goto fail; } @@ -4755,6 +4798,10 @@ int IPACM_Wan::handle_down_evt_ex() handle_route_del_evt_ex(IPA_IP_v4); #ifdef FEATURE_IPA_ANDROID /* posting wan_down_tether for all lan clients */ +#ifdef FEATURE_IPACM_HAL + IPACMDBG_H("Posting IPA_WAN_DOWN_TETHER_EVENT for IPV4\n"); + post_wan_down_tether_evt(IPA_IP_v4, 0); +#else for (i=0; i < IPACM_Wan::ipa_if_num_tether_v4_total; i++) { ipa_if_num_tether_tmp[i] = IPACM_Wan::ipa_if_num_tether_v4[i]; @@ -4767,11 +4814,16 @@ int IPACM_Wan::handle_down_evt_ex() i, IPACM_Iface::ipacmcfg->iface_table[ipa_if_num_tether_tmp[i]].iface_name); } #endif +#endif IPACM_Wan::wan_up_v6 = false; del_wan_firewall_rule(IPA_IP_v6); handle_route_del_evt_ex(IPA_IP_v6); #ifdef FEATURE_IPA_ANDROID /* posting wan_down_tether for all lan clients */ +#ifdef FEATURE_IPACM_HAL + IPACMDBG_H("Posting IPA_WAN_DOWN_TETHER_EVENT for IPV6\n"); + post_wan_down_tether_evt(IPA_IP_v6, 0); +#else for (i=0; i < IPACM_Wan::ipa_if_num_tether_v6_total; i++) { ipa_if_num_tether_tmp[i] = IPACM_Wan::ipa_if_num_tether_v6[i]; @@ -4784,6 +4836,7 @@ int IPACM_Wan::handle_down_evt_ex() i, IPACM_Iface::ipacmcfg->iface_table[ipa_if_num_tether_tmp[i]].iface_name); } #endif +#endif memset(IPACM_Wan::wan_up_dev_name, 0, sizeof(IPACM_Wan::wan_up_dev_name)); install_wan_filtering_rule(false); diff --git a/ipacm/src/IPACM_Wlan.cpp b/ipacm/src/IPACM_Wlan.cpp index 0669b80..a97c0a0 100644 --- a/ipacm/src/IPACM_Wlan.cpp +++ b/ipacm/src/IPACM_Wlan.cpp @@ -323,6 +323,18 @@ void IPACM_Wlan::event_callback(ipa_cm_event_id event, void *param) } else { IPACMDBG_H("Wan_V6 haven't up yet \n"); } +#else + /* check if Upstream was set before */ + if (IPACM_Wan::isWanUP(ipa_if_num)) + { + IPACMDBG_H("Upstream was set previously for ipv4, change is_upstream_set flag\n"); + is_upstream_set[IPA_IP_v4] = true; + } + if (IPACM_Wan::isWanUP_V6(ipa_if_num)) + { + IPACMDBG_H("Upstream was set previously for ipv6, change is_upstream_set flag\n"); + is_upstream_set[IPA_IP_v6] = true; + } #endif /* checking if SW-RT_enable */ if (IPACM_Iface::ipacmcfg->ipa_sw_rt_enable == true) |