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 4af1b574bf..6b4f2139c9 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 @@ -301,7 +301,8 @@ void foe_clear_entry(struct neighbour *neigh) 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);