[qca-nss-ecm] Added a NULL check for IPv6 gateway address
In some scenario (i.e DS-lite) the gateway address of a IPv6
flow is NULL and RTF_GATEWAY bit is not set if sourece and
destination address is in same network. In such cases check
if gateway address is NULL and do not overwrite the destination
IPv6 address used for dest MAC lookup.
Change-Id: Ic78e1397f6f44e39f1dd5729805ad71df74e4692
Signed-off-by: Shyam Sunder <ssunde@codeaurora.org>
diff --git a/frontends/ecm_front_end_ipv6.c b/frontends/ecm_front_end_ipv6.c
index f5558f0..7459d9a 100644
--- a/frontends/ecm_front_end_ipv6.c
+++ b/frontends/ecm_front_end_ipv6.c
@@ -170,7 +170,9 @@
* for routed connections.
*/
if (!ECM_IP_ADDR_MATCH(rt->rt6i_dst.addr.in6_u.u6_addr32, rt->rt6i_gateway.in6_u.u6_addr32) || (rt->rt6i_flags & RTF_GATEWAY)) {
- ECM_NIN6_ADDR_TO_IP_ADDR(rt_dst_addr, rt->rt6i_gateway);
+ if (!ECM_IP_ADDR_IS_NULL(rt->rt6i_gateway.in6_u.u6_addr32)) {
+ ECM_NIN6_ADDR_TO_IP_ADDR(rt_dst_addr, rt->rt6i_gateway);
+ }
}
from = skb->dev;