diff options
author | Skylar Chang <chiaweic@codeaurora.org> | 2015-03-27 20:28:35 -0700 |
---|---|---|
committer | Skylar Chang <chiaweic@codeaurora.org> | 2015-04-02 18:23:08 -0700 |
commit | 9b85a079490fe3dd3bf176af6aa3f81eb178eb63 (patch) | |
tree | 1ff83c7675464e5058268b5ae9044eff0350c52d /ipacm/src/IPACM_ConntrackListener.cpp | |
parent | 82e8c94ab624502e9628f93e23bc947200369840 (diff) | |
download | ipacfg-mgr-9b85a079490fe3dd3bf176af6aa3f81eb178eb63.tar.gz |
IPACM: First AP+STA connection is taking sw path
cache the nat connection if external AP client
neighbour ip address event doest not received
Add the cached connection to IPA HW table on
receiving external AP client neighbour ip address event
Change-Id: I92f7f934ef83cb539e340ff1f0aaaa2dd23b56f8
Acked-by: Sunil Paidimarri <hisunil@qti.qualcomm.com>
Diffstat (limited to 'ipacm/src/IPACM_ConntrackListener.cpp')
-rw-r--r-- | ipacm/src/IPACM_ConntrackListener.cpp | 69 |
1 files changed, 35 insertions, 34 deletions
diff --git a/ipacm/src/IPACM_ConntrackListener.cpp b/ipacm/src/IPACM_ConntrackListener.cpp index 9e66a00..4ad0164 100644 --- a/ipacm/src/IPACM_ConntrackListener.cpp +++ b/ipacm/src/IPACM_ConntrackListener.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2013, The Linux Foundation. All rights reserved. +Copyright (c) 2013-2015, 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 @@ -699,22 +699,20 @@ void IPACM_ConntrackListener::ProcessTCPorUDPMsg( return; } - if(orig_src_ip == wan_ipaddr) - { - IPACMDBG("orig src ip:0x%x equal to wan ip\n",orig_src_ip); - status = IPS_SRC_NAT; - rule.public_ip = wan_ipaddr; - } - else if(orig_dst_ip == wan_ipaddr) - { - IPACMDBG("orig Dst IP:0x%x equal to wan ip\n",orig_dst_ip); - status = IPS_DST_NAT; - rule.public_ip = wan_ipaddr; - } - else - { - IPACMDBG("Neither orig src ip:0x%x Nor orig Dst IP:0x%x equal to wan ip:0x%x\n", - orig_src_ip, orig_dst_ip, wan_ipaddr); + if(orig_src_ip == wan_ipaddr) + { + IPACMDBG("orig src ip:0x%x equal to wan ip\n",orig_src_ip); + status = IPS_SRC_NAT; + } + else if(orig_dst_ip == wan_ipaddr) + { + IPACMDBG("orig Dst IP:0x%x equal to wan ip\n",orig_dst_ip); + status = IPS_DST_NAT; + } + else + { + IPACMDBG("Neither orig src ip:0x%x Nor orig Dst IP:0x%x equal to wan ip:0x%x\n", + orig_src_ip, orig_dst_ip, wan_ipaddr); #ifdef CT_OPT if(p_lan2lan == NULL) @@ -849,13 +847,13 @@ void IPACM_ConntrackListener::ProcessTCPorUDPMsg( } } - if(cnt == MAX_NAT_IFACES) - { - IPACMDBG("Not mtaching with nat ifaces\n") - if(pConfig == NULL) - { - goto IGNORE; - } + if(cnt == MAX_NAT_IFACES) + { + IPACMDBG("Not mtaching with nat ifaces\n"); + if(pConfig == NULL) + { + goto IGNORE; + } if(pConfig->isPrivateSubnet(rule.private_ip) || pConfig->isPrivateSubnet(rule.target_ip)) @@ -911,9 +909,9 @@ void IPACM_ConntrackListener::ProcessTCPorUDPMsg( } } - IPACMDBG("Not matching with STA Clnt Ip Addrs 0x%x\n", - rule.target_ip); - goto IGNORE; + IPACMDBG("Not matching with STA Clnt Ip Addrs 0x%x\n", + rule.target_ip); + isTempEntry = true; ADD: @@ -925,12 +923,13 @@ ADD: IPACMDBG("public port or reply dst port: 0x%x, Decimal:%d\n", rule.public_port, rule.public_port); IPACMDBG("Protocol: %d, destination nat flag: %d\n", rule.protocol, rule.dst_nat); - if(IPPROTO_TCP == rule.protocol) - { - if(nat_inst == NULL) - { - return; - } + rule.public_ip = wan_ipaddr; + if(IPPROTO_TCP == rule.protocol) + { + if(nat_inst == NULL) + { + return; + } tcp_state = nfct_get_attr_u8(ct, ATTR_TCP_STATE); if(TCP_CONNTRACK_ESTABLISHED == tcp_state) @@ -1059,6 +1058,7 @@ void IPACM_ConntrackListener::HandleSTAClientAddEvt(uint32_t clnt_ip_addr) } + nat_inst->FlushTempEntries(clnt_ip_addr, true); return; } @@ -1082,5 +1082,6 @@ void IPACM_ConntrackListener::HandleSTAClientDelEvt(uint32_t clnt_ip_addr) } } - return; + nat_inst->FlushTempEntries(clnt_ip_addr, false); + return; } |