[qca-nss-ecm] is_routed flag and ecm_dir should match

Check if is_router flag and ethe ecm_dir direction
are consistent with each other. If the packet comes from
bridge post routing hook, is_routed flag is false and
the ecm_dir calculation must be bridge direction.
This becomes an issue in hairpin NAT scenario, where
the LAN client accesses to the LAN server with its
private IP address instead of the WAN IP address of the
device. In this case, SNAT is applied to the bridge
packet and ECM calculates the direction of the packet
as egress NAT which is wrong. So, we shouldn't process
these packets and wait for them to hit to the IPv4 post
routing hook.

Change-Id: Ie89f5d16708e7b8235a2419c8f9bb4a197ca5e82
Signed-off-by: Murat Sezgin <msezgin@codeaurora.org>
1 file changed