From: Radu Rendec <radu.ren...@gmail.com>
Date: Sat, 29 Dec 2018 13:26:34 -0500

> I'm working on some application-specific NIC driver. On the TX path, it
> must remove a custom tag that sits between the Ethernet type field and
> the actual Ethernet payload; then it must add a different tag in front
> of the Ethernet header (the MAC DA field) before it hands over the frame
> to the hardware for delivery.
> 
> I'm wondering if skb_cow_head() is enough to safely modify the skb as
> described above, or I should use skb_cow() instead.

skb_cow_head() should be sufficient.  This is what the DSA layer tagging
code uses, and it is doing something similar if not exactly like what you
are doing.

See net/dsa/tag_dsa.c:dsa_xmit().

Reply via email to