commit | b45dece60ab1e3534ce57e3fa9ce7197a6e9f88e | [log] [tgz] |
---|---|---|
author | developer <developer@mediatek.com> | Mon Aug 21 19:42:08 2023 +0800 |
committer | developer <developer@mediatek.com> | Wed Aug 23 09:43:04 2023 +0800 |
tree | e5fb3d9e4eb4c2d97a874d5654bfe08b94620f3c | |
parent | 392c9809c93d2749595874a1b7213da0aa0bec90 [diff] |
[][Kernel][hnat][Fix ipv4 in ipv6 packets can't be bind in MAPE scene] [Description] Fix ipv4 in ipv6 packets can't be bind in MAPE scene. Move the action of checking ip framgnet packets from mtk_hnat_nf_post_routing to skb_to_hnat_info. [Release-log] N/A Change-Id: I11db24f10a7c6b4221e84c86d8633af801dd5f25 Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7908925
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 31c03ca..d34ac9d 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
@@ -1246,6 +1246,10 @@ switch (ntohs(eth->h_proto)) { case ETH_P_IP: iph = ip_hdr(skb); + /* Do not bind if pkt is fragmented */ + if (ip_is_fragment(iph)) + return 0; + switch (iph->protocol) { case IPPROTO_UDP: udp = 1; @@ -2521,10 +2525,6 @@ if (unlikely(!skb_hnat_is_hashed(skb))) return 0; - /* Do not bind if pkt is fragmented */ - if (ip_is_fragment(ip_hdr(skb))) - return 0; - if (out->netdev_ops->ndo_flow_offload_check) { out->netdev_ops->ndo_flow_offload_check(&hw_path); out = (IS_GMAC1_MODE) ? hw_path.virt_dev : hw_path.dev;