commit | f687225fb98a52d3f6c1de4755635838dc46cc27 | [log] [tgz] |
---|---|---|
author | developer <developer@mediatek.com> | Tue May 23 18:21:08 2023 +0800 |
committer | developer <developer@mediatek.com> | Wed May 24 16:08:55 2023 +0800 |
tree | 227c7f9b5b858bf65f45f2316be182c8c2efe85c | |
parent | 3f9a06c83370fa344d6c639dc3f1e445bf323e35 [diff] |
[][kernel][common][hnat][Fix the issue of mistakenly deleting entries in foe_clear_entry] [Description] Fix the issue of mistakenly deleting entries in foe_clear_entry. When packets are forwarded in the 6RD scenario, HNAT entry is mistakenly deleted. This patch fix it. [Release-log] N/A Change-Id: I7ece4115f07eaca354d2c0301d6cafb2ba6e539c Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7531312
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 2e68d3d..95e5e3c 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
@@ -291,7 +291,8 @@ for (hash_index = 0; hash_index < hnat_priv->foe_etry_num; hash_index++) { entry = hnat_priv->foe_table_cpu[i] + hash_index; if (entry->bfib1.state == BIND && - entry->ipv4_hnapt.new_dip == ntohl(dip)) { + entry->ipv4_hnapt.new_dip == ntohl(dip) && + IS_IPV4_HNAPT(entry)) { *((u32 *)h_dest) = swab32(entry->ipv4_hnapt.dmac_hi); *((u16 *)&h_dest[4]) = swab16(entry->ipv4_hnapt.dmac_lo);