Skip to content

Commit 9df90a8

Browse files
jsitnickiKernel Patches Daemon
authored andcommitted
xdp: 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 just past the metadata area. Tweak XDP generic mode accordingly. Signed-off-by: Jakub Sitnicki <[email protected]>
1 parent 495f04c commit 9df90a8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/core/dev.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5461,8 +5461,11 @@ u32 bpf_prog_run_generic_xdp(struct sk_buff *skb, struct xdp_buff *xdp,
54615461
break;
54625462
case XDP_PASS:
54635463
metalen = xdp->data - xdp->data_meta;
5464-
if (metalen)
5464+
if (metalen) {
5465+
__skb_push(skb, mac_len);
54655466
skb_metadata_set(skb, metalen);
5467+
__skb_pull(skb, mac_len);
5468+
}
54665469
break;
54675470
}
54685471

0 commit comments

Comments
 (0)