--- zzzz-none-000/linux-5.15.111/net/netfilter/nf_queue.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/net/netfilter/nf_queue.c 2024-02-07 10:23:30.000000000 +0000 @@ -18,7 +18,9 @@ #include #include #include - +#if defined(CONFIG_APPCPU_GW_PP_HANDLE) || defined(CONFIG_TI_PACKET_PROCESSOR) +#include +#endif /* CONFIG_APPCPU_GW_PP_HANDLE || CONFIG_TI_PACKET_PROCESSOR*/ #include "nf_internals.h" static const struct nf_queue_handler __rcu *nf_queue_handler; @@ -350,6 +352,38 @@ case NF_STOLEN: break; default: +#if defined(CONFIG_APPCPU_GW_PP_HANDLE) || defined(CONFIG_TI_PACKET_PROCESSOR) + { + int skip_pp_discard=0; + struct ethhdr* ptr_ethhdr = NULL; + +#define MAC_ISMULTICAST( pa, hw ) ( ((pa)->hw[0] & 0x01) ) +#define MAC_ISBROADCAST( pa, hw ) ( ~0xFF ==( (~(pa)->hw[0]) | \ + (~(pa)->hw[1]) | \ + (~(pa)->hw[2]) | \ + (~(pa)->hw[3]) | \ + (~(pa)->hw[4]) | \ + (~(pa)->hw[5]) )) + + ptr_ethhdr = eth_hdr(skb); + + if ( ptr_ethhdr) + { + /* Check if the package is the multicast type, but not a broadcast */ + if ( ( ! (MAC_ISBROADCAST (ptr_ethhdr, h_dest)) ) && + ( MAC_ISMULTICAST (ptr_ethhdr, h_dest)) ) + { + skip_pp_discard=1; + printk(KERN_DEBUG "NF_DROP :Multicast pkg, Do not create PP drop session\n" ); + } + } + + if ( ! skip_pp_discard ) + { + ti_hil_pp_event (TI_CT_NETFILTER_DISCARD_PKT, (void *)skb); + } + } +#endif /* CONFIG_APPCPU_GW_PP_HANDLE || CONFIG_TI_PACKET_PROCESSOR*/ kfree_skb(skb); }