Skip to content

Commit

Permalink
selftests/bpf: fix BPF-CI issue
Browse files Browse the repository at this point in the history
BPF-CI's iproute2 is too old:

libbpf/ci#103

Some workaround to avoid running into the relocation issue.

Signed-off-by: Yan Zhai <[email protected]>
  • Loading branch information
Yan Zhai committed Aug 17, 2023
1 parent 153f3d8 commit eefa61e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tools/testing/selftests/bpf/progs/test_lwt_redirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@ static int prepend_dummy_mac(struct __sk_buff *skb)
char mac[] = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0xf,
0xe, 0xd, 0xc, 0xb, 0xa, 0x08, 0x00};

if (bpf_skb_change_head(skb, ETH_HLEN, 0)) {
bpf_printk("%s: fail to change head", __func__);
if (bpf_skb_change_head(skb, ETH_HLEN, 0))
return -1;
}

if (bpf_skb_store_bytes(skb, 0, mac, sizeof(mac), 0)) {
bpf_printk("%s: fail to update mac", __func__);
if (bpf_skb_store_bytes(skb, 0, mac, sizeof(mac), 0))
return -1;
}

return 0;
}
Expand Down

0 comments on commit eefa61e

Please sign in to comment.