On Wednesday 2023-05-31 17:01, Jeremy Sowden wrote: >> >> It should be possible to just take the code from xt_ECHO and call >> >> if (skb_linearize(skb) < 0) >> return false; >> >> However, none of the xtables matches in the Linux kernel do this >> linearization, at least not that I can see directly. > >They use `skb_header_pointer` instead, I think, which handles the >linearization behind the scenes. I'll send a patch. Yeah, header_pointer extracts bytes if need be, which means you need to have a sufficiently large buffer to copy to. Just hope you don't get any IPv6 jumbo packet, eh?