Re: [PATCH nf] netfilter: nfnetlink_queue: unclone skb before writing NFQA_L2HDR
From: Tamaki Yanagawa
Date: Sat Nov 07 2026 - 11:32:44 EST
Florian Westphal <fw@xxxxxxxxx> wrote:
> Can you explain in changelog why full unclone is needed rather than
> skb_ensure_writable()?
It isn't. At the bridge hooks skb->data points to the network header, so
the mac header is in the headroom, and skb_clone_writable() already
checks headroom against hdr_len. skb_ensure_writable(skb, 0) is enough
and also avoids copying clones that own their header area. I'll send a
v2 using it and saying so in the changelog. I re-ran the bridge flood
test with it: the frame on the other port keeps its original header.
Thanks,
Tamaki