Skip to content

Commit 997747f

Browse files
committed
packet04-tailgrow: check return value of bpf_xdp_adjust_tail
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
1 parent f988eec commit 997747f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packet04-tailgrow/xdp_prog_kern.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ int grow_parse(struct xdp_md *ctx)
6565

6666
struct my_timestamp *ts;
6767

68-
/* Increase packet size and reload data pointers */
68+
/* Increase packet size (at tail) and reload data pointers */
6969
__u8 offset = sizeof(*ts);
70-
bpf_xdp_adjust_tail(ctx, offset);
70+
if (bpf_xdp_adjust_tail(ctx, offset))
71+
goto out;
7172
data_end = (void *)(long)ctx->data_end;
7273
data = (void *)(long)ctx->data;
7374

0 commit comments

Comments
 (0)