Skip to content

Commit

Permalink
bpf: fix build with some libpcap version on FreeBSD
Browse files Browse the repository at this point in the history
[ upstream commit 63f39a4 ]

This is something caught in UNH FreeBSD env.

For some reason [1], the pcap/bpf.h header started to define _BPF_H_.

It happens that the bpf_impl.h internal DPDK header uses this define as
an internal guard.
This triggers a build failure in bpf_convert.c which can't find
RTE_BPF_LOG macro.

Fix the include guard to use the filename and remove _.

1: the-tcpdump-group/libpcap#1074

Fixes: 94972f3 ("bpf: add BPF loading and execution framework")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  • Loading branch information
david-marchand authored and kevintraynor committed Mar 15, 2022
1 parent 75c5700 commit 0a38dcb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/bpf/bpf_impl.h
Expand Up @@ -2,8 +2,8 @@
* Copyright(c) 2018 Intel Corporation
*/

#ifndef _BPF_H_
#define _BPF_H_
#ifndef BPF_IMPL_H
#define BPF_IMPL_H

#include <rte_bpf.h>
#include <sys/mman.h>
Expand Down Expand Up @@ -43,4 +43,4 @@ bpf_size(uint32_t bpf_op_sz)
return 0;
}

#endif /* _BPF_H_ */
#endif /* BPF_IMPL_H */

0 comments on commit 0a38dcb

Please sign in to comment.