On Thu, Oct 01, 2026 at 12:39:25PM +0300, Anton Danilov wrote:
tun_get_user() is the only user of SKB_DROP_REASON_HDR_TRUNC. It sets
it when pskb_may_pull() fails to pull the Ethernet header of a frame
written to a TAP device.
pskb_may_pull_reason() reports why the pull failed: PKT_TOO_SMALL if
the packet is shorter than requested, NOMEM if pulling the data into
the linear area fails. Use it for the Ethernet header pull in
tun_get_user() and remove the now unused SKB_DROP_REASON_HDR_TRUNC.
After a successful pull drop_reason is SKB_NOT_DROPPED_YET. The path
that later finds the queue detached has no reason of its own and relied
on the SKB_DROP_REASON_NOT_SPECIFIED initializer. Fall back to
SKB_DROP_REASON_NOT_SPECIFIED at the free_skb label, as vxlan_rcv()
does, so that this path, and any later one without a reason of its own,
keeps reporting it.
The error returned to user space does not change.
Suggested-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/netdev/20260923145931.GA2859441@shredder/ (local)
Assisted-by: LLM
Signed-off-by: Anton Danilov <redacted>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
I will check the other series next week.