Skip to content

Commit

Permalink
headers: add bpf_endian.h for parsing_helpers.h
Browse files Browse the repository at this point in the history
bpf_endian.h should always be put ahead of parsing_helpers.h
otherwise loading prog will complain like below:
libbpf: failed to find BTF for extern 'bpf_htons': -2

So to make life easier, add it to the header file directly.

Signed-off-by: junka <wan.junjie@foxmail.com>
  • Loading branch information
junka authored and tohojo committed Nov 29, 2022
1 parent 32aaf32 commit 6049671
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions headers/xdp/parsing_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/udp.h>
#include <linux/tcp.h>
#include <linux/in.h>
#include <bpf/bpf_endian.h>

/* Header cursor to keep track of current parsing position */
struct hdr_cursor {
Expand Down
1 change: 0 additions & 1 deletion xdp-filter/xdpfilt_prog.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <linux/bpf.h>
#include <linux/in.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_endian.h>
#include <xdp/xdp_helpers.h>

#include "common_kern_user.h"
Expand Down

0 comments on commit 6049671

Please sign in to comment.