diff options
author | Skylar Chang <chiaweic@codeaurora.org> | 2015-07-28 21:18:49 -0700 |
---|---|---|
committer | Skylar Chang <chiaweic@codeaurora.org> | 2015-07-29 16:29:53 -0700 |
commit | fafb397030dfcc60cbf35a23b550f2e1c38e43ce (patch) | |
tree | 2583efbeb1a6f2d1c522c97be840719d56664b8f /ipacm/src/IPACM_Config.cpp | |
parent | 3ca162709eb22e9cf3d652833a80a093d232db93 (diff) | |
download | ipacfg-mgr-fafb397030dfcc60cbf35a23b550f2e1c38e43ce.tar.gz |
IPACM: Fix the nat iface missing when cfg change
In AP+AP mode swtich, IPACM_cfg.xml will be updated
on the fly when netdev interface already up while
IPACM loses the NAT ifaces in its config cache and
resulted in NAT-miss for all these pre-existing
netdev interfaces. Also we see more frequent NETBIOS_NS
embedded traffic on port 138 which exhausted our
nat cache. The fix is to add prot 138 traffic as ALG
port, also did the ALG port checking on NAT cache and
those existing ifaces will add itself to NAT ifaces
when receiving the cfg_change event.
Change-Id: I42921b29d70a345b20a71aaf35711c005849ef31
Diffstat (limited to 'ipacm/src/IPACM_Config.cpp')
-rw-r--r-- | ipacm/src/IPACM_Config.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ipacm/src/IPACM_Config.cpp b/ipacm/src/IPACM_Config.cpp index 69e2b41..24890ed 100644 --- a/ipacm/src/IPACM_Config.cpp +++ b/ipacm/src/IPACM_Config.cpp @@ -238,6 +238,7 @@ int IPACM_Config::Init(void) pNatIfaces = NULL; IPACMDBG_H("RESET IPACM_Config::pNatIfaces \n"); } + ipa_nat_iface_entries = 0; pNatIfaces = (NatIfaces *)calloc(ipa_num_ipa_interfaces, sizeof(NatIfaces)); if (pNatIfaces == NULL) { @@ -423,6 +424,19 @@ int IPACM_Config::GetNatIfaces(int nIfaces, NatIfaces *pIfaces) int IPACM_Config::AddNatIfaces(char *dev_name) { + int i; + /* Check if this iface already in NAT-iface*/ + for(i = 0; i < ipa_nat_iface_entries; i++) + { + if(strncmp(dev_name, + pNatIfaces[i].iface_name, + sizeof(pNatIfaces[i].iface_name)) == 0) + { + IPACMDBG("Interface (%s) is add to nat iface already\n", dev_name); + return 0; + } + } + IPACMDBG_H("Add iface %s to NAT-ifaces, origin it has %d nat ifaces\n", dev_name, ipa_nat_iface_entries); ipa_nat_iface_entries++; |