Skip to content

Commit 2fe6b0b

Browse files
committed
Compile libpcap with --disable-protochain
There is a known issue that cloudfare/cbpfc can't properly handle "jump back" cBPF: cloudflare/cbpfc#36. Unfortunately, "protochain" pcap filter often generates such "jump back" instructions, leading to errors like: unable to compute blocks: instruction 18: ja 4294967281 flows past last instruction This patch disables protochain when compiling libpcap, so users receive a clearer error: $ pwru ip6 protochain 58 2025/05/23 22:42:53 Failed to inject filter ebpf for kprobe_multi_skb_5: failed to pcap_compile 'ip6 protochain 58': protochain not supported (l3=false) Signed-off-by: gray <[email protected]>
1 parent a7f9086 commit 2fe6b0b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

KNOWN_ISSUES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,11 @@ In some kernel versions, SELinux has a problem that it always generates the audi
5757
This issue was introduced in [this commit](https://github.com/torvalds/linux/commit/59438b46471ae6cdfb761afc8c9beaf1e428a331) (v5.6-rc1) and fixed in [this commit](https://github.com/torvalds/linux/commit/ff40e51043af63715ab413995ff46996ecf9583f) (v5.13-rc5) in the upstream kernel. So, any kernel using the revision between those two commits may be affected unless the fix is not backported.
5858

5959
To work around this issue, you can disable the SELinux or make it permissive mode, but we strongly encourage you to upgrade the kernel instead.
60+
61+
## protochain not supported
62+
63+
Pwru currently does not support the protochain pcap filter, such as `ip6 protochain 58`. This limitation is due to an issue in the cBPF-to-eBPF translation library cloudflare/cbpfc, which cannot correctly handle "jump back" instructions generated by protochain. See https://github.com/cloudflare/cbpfc/pull/36.
64+
65+
As a result, Pwru disables protochain support when compiling with libpcap to improve user experience. Once the issue in cloudflare/cbpfc is resolved, we plan to re-enable support for protochain.
66+
67+
See: https://github.com/cilium/pwru/issues/549

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pwru: libpcap/libpcap.a
2626
## Build libpcap for static linking
2727
libpcap/libpcap.a:
2828
cd libpcap && \
29-
CC=$(LIBPCAP_CC) ./configure --disable-rdma --disable-shared --disable-usb --disable-netmap --disable-bluetooth --disable-dbus --without-libnl --host=$(LIBPCAP_ARCH) && \
29+
CC=$(LIBPCAP_CC) ./configure --disable-protochain --disable-rdma --disable-shared --disable-usb --disable-netmap --disable-bluetooth --disable-dbus --without-libnl --host=$(LIBPCAP_ARCH) && \
3030
make
3131

3232
## Build the GO binary within a Docker container

0 commit comments

Comments
 (0)