--- zzzz-none-000/linux-5.4.213/net/ethernet/eth.c 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/net/ethernet/eth.c 2024-08-14 09:02:13.000000000 +0000 @@ -143,6 +143,18 @@ } EXPORT_SYMBOL(eth_get_headlen); +static inline bool +eth_check_local_mask(const void *addr1, const void *addr2, const void *mask) +{ + const u16 *a1 = addr1; + const u16 *a2 = addr2; + const u16 *m = mask; + + return (((a1[0] ^ a2[0]) & ~m[0]) | + ((a1[1] ^ a2[1]) & ~m[1]) | + ((a1[2] ^ a2[2]) & ~m[2])); +} + /** * eth_type_trans - determine the packet's protocol ID. * @skb: received socket data @@ -159,6 +171,12 @@ const struct ethhdr *eth; skb->dev = dev; + +#ifdef CONFIG_ETHERNET_PACKET_MANGLE + if (dev->eth_mangle_rx) + dev->eth_mangle_rx(dev, skb); +#endif + skb_reset_mac_header(skb); eth = (struct ethhdr *)skb->data; @@ -174,6 +192,10 @@ } else { skb->pkt_type = PACKET_OTHERHOST; } + + if (eth_check_local_mask(eth->h_dest, dev->dev_addr, + dev->local_addr_mask)) + skb->gro_skip = 1; } /*