[qca-nss-ecm] Fix gw check by check both on_link and for null

Change-Id: I26af21acd1e26589999b052228fe4103d923c1e6
Signed-off-by: Murat Sezgin <msezgin@codeaurora.org>
diff --git a/ecm_front_end_ipv4.c b/ecm_front_end_ipv4.c
index 6519400..5e00591 100644
--- a/ecm_front_end_ipv4.c
+++ b/ecm_front_end_ipv4.c
@@ -273,7 +273,7 @@
 				/*
 				 * If we have a GW for this address, then we have to send ARP request to the GW
 				 */
-				if (!on_link) {
+				if (!on_link && !ECM_IP_ADDR_IS_NULL(gw_addr)) {
 					ECM_IP_ADDR_TO_NIN4_ADDR(ipv4_addr, gw_addr);
 				}
 
diff --git a/ecm_interface.c b/ecm_interface.c
index c010f86..c0ab3e8 100644
--- a/ecm_interface.c
+++ b/ecm_interface.c
@@ -1581,7 +1581,7 @@
 					 * Figure out which port device the skb will go to using the dest_addr.
 					 */
 					bool on_link;
-					ip_addr_t gw_addr;
+					ip_addr_t gw_addr = ECM_IP_ADDR_NULL;
 					uint8_t mac_addr[ETH_ALEN];
 					if (!ecm_interface_mac_addr_get(dest_addr, mac_addr, &on_link, gw_addr)) {
 						/*
@@ -1613,7 +1613,7 @@
 							/*
 							 * If we have a GW for this address, then we have to send ARP request to the GW
 							 */
-							if (!on_link) {
+							if (!on_link && !ECM_IP_ADDR_IS_NULL(gw_addr)) {
 								ECM_IP_ADDR_TO_NIN4_ADDR(ipv4_addr, gw_addr);
 							}