Skip to content

Commit 0df3d70

Browse files
jsitnickiKernel Patches Daemon
authored andcommitted
veth: Call skb_metadata_set when skb->data points at metadata end
Prepare to track skb metadata location independently of MAC header offset. Following changes will make skb_metadata_set() record where metadata ends relative to skb->head. Hence the helper must be called when skb->data points right past the metadata area. Unlike other drivers, veth calls skb_metadata_set() after eth_type_trans(), which pulls the Ethernet header and moves skb->data. This violates the future calling convention. Adjust the driver to pull the MAC header after calling skb_metadata_set(). Signed-off-by: Jakub Sitnicki <[email protected]>
1 parent 150c2e4 commit 0df3d70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/veth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,11 +876,11 @@ static struct sk_buff *veth_xdp_rcv_skb(struct veth_rq *rq,
876876
else
877877
skb->data_len = 0;
878878

879-
skb->protocol = eth_type_trans(skb, rq->dev);
880-
881879
metalen = xdp->data - xdp->data_meta;
882880
if (metalen)
883881
skb_metadata_set(skb, metalen);
882+
883+
skb->protocol = eth_type_trans(skb, rq->dev);
884884
out:
885885
return skb;
886886
drop:

0 commit comments

Comments
 (0)