[][Fix order of setting TTL in HNAT]

[Description]
Fix order of setting TTL in HNAT.
Eth->WIFI, HNAT binding path can be divided into two parts(skb_to_hnat_info,mtk_sw_nat_hook_tx)
Therefore, HNAT cannot bind when the following conditions are encountered:
1: Send unknown unicast pkts to eth, set TTL in skb_to_hnat_info(unbind: pre-bind).
   Then wifi checks that the pkts is not sent to the associated STA,
   discards the pkts, and can not call mtk_sw_nat_hook_tx.
2: Stop the traffic, the hnat entry cannot be aged.
3: After MAC learning, send the traffic again.
   At this time, the cpu cause of pkts is HIT_PRE_BIND,
   so skb_to_hnat_info, mtk_sw_nat_hook_tx cannot be called.

This patch fixes it, bind HNAT immediately after setting TTL.

[Release-log]
N/A

Change-Id: I16bbe00f328e3a01c697d34731711b4d6326dd90
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6000747
diff --git a/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.c b/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.c
index d0f9cec..ccb4525 100644
--- a/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.c
+++ b/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.c
@@ -1114,7 +1114,6 @@
 	entry.bfib1.psn = (hw_path->flags & FLOW_OFFLOAD_PATH_PPPOE) ? 1 : 0;
 	entry.bfib1.vlan_layer += (hw_path->flags & FLOW_OFFLOAD_PATH_VLAN) ? 1 : 0;
 	entry.bfib1.vpm = (entry.bfib1.vlan_layer) ? 1 : 0;
-	entry.bfib1.ttl = 1;
 	entry.bfib1.cah = 1;
 	entry.bfib1.time_stamp = (hnat_priv->data->version == MTK_HNAT_V4) ?
 		readl(hnat_priv->fe_base + 0x0010) & (0xFF) :
@@ -1648,8 +1647,10 @@
 	 * by Wi-Fi whnat engine. These data and INFO2.dp will be updated and
 	 * the entry is set to BIND state in mtk_sw_nat_hook_tx().
 	 */
-	if (!whnat)
+	if (!whnat) {
+		entry.bfib1.ttl = 1;
 		entry.bfib1.state = BIND;
+	}
 
 	wmb();
 	memcpy(foe, &entry, sizeof(entry));
@@ -1822,6 +1823,7 @@
 		entry->ipv6_5t_route.iblk2.dp = gmac_no;
 	}
 
+	bfib1_tx.ttl = 1;
 	bfib1_tx.state = BIND;
 	wmb();
 	memcpy(&entry->bfib1, &bfib1_tx, sizeof(bfib1_tx));