[][[Kernel][common][hnat]Fix WAN->LAN UNBIND in MAPE/DS_Lite scenario]
[Description]
Fix WAN->LAN UNBIND in MAPE/DS_Lite scenario.
Due to uninitialized local variable hw_path,
the tops-related code incorrectly sets the "alg" field,
leading to WAN -> LAN acceleration failure.
[Release-log]
NA
Change-Id: I7d338065c97ef68ba97be15415e9ecbabde33512
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/9450227
diff --git a/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.c b/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.c
index 680d67c..e28b349 100644
--- a/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.c
+++ b/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.c
@@ -843,7 +843,7 @@
mtk_hnat_ipv4_nf_pre_routing(void *priv, struct sk_buff *skb,
const struct nf_hook_state *state)
{
- struct flow_offload_hw_path hw_path;
+ struct flow_offload_hw_path hw_path = { 0 };
if (!skb)
goto drop;
@@ -2766,7 +2766,7 @@
static unsigned int mtk_hnat_nf_post_routing(
struct sk_buff *skb, const struct net_device *out,
int (*fn)(struct sk_buff *, const struct net_device *,
- struct flow_offload_hw_path *),
+ struct flow_offload_hw_path *),
const char *func)
{
struct foe_entry *entry;