Skip to content

Conversation

@teleostnacl
Copy link
Contributor

@teleostnacl teleostnacl commented Nov 16, 2025

Since compiling tcpbridge requires linking libbpf.so.1, compiling tcpbridge first may result in compilation failure, like:
Package tcpbridge is missing dependencies for the following libraries: libbpf.so.1

The simplest way to solve it is to add libbpf dependency in Makefile

📦 Package Details

Maintainer: Alexandru Ardelean [email protected]

Description:
Add a dependency on libbpf in tcprepaly


🧪 Run Testing Details

  • OpenWrt Version: OpenWrt SNAPSHOT r31857-501f4edb04
  • OpenWrt Target/Subtarget: mediatek/filogic
  • OpenWrt Device: CMCC RAX3000M

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/<your-package>/refresh V=s
  • It is structured in a way that it is potentially upstreamable

@teleostnacl teleostnacl force-pushed the fix_tcpreply_dependency branch from 1488fa6 to 2d7d46b Compare November 16, 2025 04:05
Since compiling tcpbridge requires linking libbpf.so.1, compiling tcpbridge first may result in compilation failure, like:
Package tcpbridge is missing dependencies for the following libraries: libbpf.so.1

The simplest way to solve it is to add libbpf dependency in Makefile

Signed-off-by: TeleostNaCl Dai <[email protected]>
@teleostnacl teleostnacl force-pushed the fix_tcpreply_dependency branch from 2d7d46b to 795bdac Compare November 16, 2025 05:38
@hnyman hnyman requested a review from commodo November 16, 2025 07:25
@hnyman
Copy link
Contributor

hnyman commented Nov 16, 2025

Tcpreplay compiles ok in buildbot (with all libraries supposedly present), so I wonder about your findings about a missing dependency.

@commodo
Copy link
Contributor

commodo commented Nov 16, 2025

Tcpreplay compiles ok in buildbot (with all libraries supposedly present), so I wonder about your findings about a missing dependency.

Looking into configure.ac this looks like an optional dependency.

AC_CHECK_HEADERS([net/bpf.h], [have_bpf=yes], [have_bpf=no])
if test $have_bpf = yes ; then
    AC_DEFINE([HAVE_BPF], [1],
            [Do we have BPF device support?])
fi  

I'm fine to have this be a dependency of tcpreplay

URL:=http://tcpreplay.appneta.com/
MAINTAINER:=Alexandru Ardelean <[email protected]>
DEPENDS:=+librt +libpcap +libdnet +USE_MUSL:musl-fts
DEPENDS:=+librt +libpcap +libdnet +libbpf +USE_MUSL:musl-fts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@teleostnacl

are you sure libbpf will be used ?

if i look into

CONFIGURE_ARGS += \
	--enable-force-pf \
...................

This will force PF_PACKET over libbpf.
So, libbpf will be pulled as a dependency, but will not be used by tcpreplay.

Copy link
Contributor

@commodo commodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@teleostnacl

This would need a Config.in option, where libbpf is chosen in a menuconfig.
By default, PF_PACKET is used (standard Linux kernel socket filtering).

libbpf may be a bit more feature-rich, but currently it needs more changes to work.

@teleostnacl
Copy link
Contributor Author

Hello @commodo
I'm sorry about I don't understand a Config.in option, could you please explain that in order to I change something.


Meanwhile, here are some adds:

When I select tcpreplay-all package, it will select all tcpreplay packages, here is ouput:

make package/tcpreplay/compile V=sc

make[2]: Entering directory 'openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory 'openwrt/scripts/config'
make[1]: Entering directory 'openwrt'
+ mkdir -p openwrt/staging_dir/target-aarch64_cortex-a53_musl
+ cd openwrt/staging_dir/target-aarch64_cortex-a53_musl
+ mkdir -p bin lib stamp usr/include usr/lib
mkdir -p openwrt/build_dir/target-aarch64_cortex-a53_musl/stamp
touch openwrt/staging_dir/target-aarch64_cortex-a53_musl/.prepared
make[2]: Entering directory 'openwrt/package/utils/lua'
make[2]: Leaving directory 'openwrt/package/utils/lua'
time: package/utils/lua/host-compile#0.15#0.02#0.17
make[2]: Entering directory 'openwrt/package/system/apk'
make[2]: Leaving directory 'openwrt/package/system/apk'
time: package/system/apk/host-compile#0.14#0.02#0.16
make[2]: Entering directory 'openwrt/package/libs/toolchain'
echo "libc" >> openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/toolchain.default.install
echo "libgcc" >> openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/toolchain.default.install
echo "libatomic" >> openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/toolchain.default.install
echo "libpthread" >> openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/toolchain.default.install
echo "librt" >> openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/toolchain.default.install
make[2]: Leaving directory 'openwrt/package/libs/toolchain'
time: package/libs/toolchain/compile#0.10#0.01#0.13
make[2]: Entering directory 'openwrt/feeds/packages/libs/libdnet'
echo "libdnet" >> openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/libdnet.default.install
make[2]: Leaving directory 'openwrt/feeds/packages/libs/libdnet'
time: package/feeds/packages/libdnet/compile#0.09#0.02#0.13
make[2]: Entering directory 'openwrt/package/libs/libpcap'
echo "libpcap" >> openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/libpcap.default.install
make[2]: Leaving directory 'openwrt/package/libs/libpcap'
time: package/libs/libpcap/compile#0.10#0.01#0.13
make[2]: Entering directory 'openwrt/package/libs/musl-fts'
echo "musl-fts" >> openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/musl-fts.default.install
make[2]: Leaving directory 'openwrt/package/libs/musl-fts'
time: package/libs/musl-fts/compile#0.17#0.02#0.20
make[2]: Entering directory 'openwrt/feeds/packages/net/tcpreplay'
rm -rf openwrt/build_dir/target-aarch64_cortex-a53_musl/tcpreplay-4.5.2/ipkg-aarch64_cortex-a53/tcpbridge
mkdir -p openwrt/bin/targets/mediatek/filogic/packages openwrt/build_dir/target-aarch64_cortex-a53_musl/tcpreplay-4.5.2/ipkg-aarch64_cortex-a53/tcpbridge openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo
install -d -m0755 openwrt/build_dir/target-aarch64_cortex-a53_musl/tcpreplay-4.5.2/ipkg-aarch64_cortex-a53/tcpbridge/usr/bin ; cp -fpR openwrt/build_dir/target-aarch64_cortex-a53_musl/tcpreplay-4.5.2/ipkg-install/usr/bin/tcpbridge openwrt/build_dir/target-aarch64_cortex-a53_musl/tcpreplay-4.5.2/ipkg-aarch64_cortex-a53/tcpbridge/usr/bin
find openwrt/build_dir/target-aarch64_cortex-a53_musl/tcpreplay-4.5.2/ipkg-aarch64_cortex-a53/tcpbridge -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf
Package tcpbridge is missing dependencies for the following libraries:
libbpf.so.1
make[2]: *** [Makefile:169: openwrt/bin/packages/aarch64_cortex-a53/packages/tcpbridge-4.5.2-r1.apk] Error 1
make[2]: Leaving directory 'openwrt/feeds/packages/net/tcpreplay'
time: package/feeds/packages/tcpreplay/compile#0.11#0.03#0.16
    ERROR: package/feeds/packages/tcpreplay failed to build.
make[1]: *** [package/Makefile:187: package/feeds/packages/tcpreplay/compile] Error 1
make[1]: Leaving directory 'openwrt'
make: *** [openwrt/include/toplevel.mk:233: package/tcpreplay/compile] Error 2

The wrong message is Package tcpbridge is missing dependencies for the following libraries: libbpf.so.1


The libbpf package is selected by ip-full package. I have no idea about whether this would have an impact.


I use ArchLinux to compile OpenWrt.

@commodo
Copy link
Contributor

commodo commented Nov 17, 2025

The libbpf package is selected by ip-full package. I have no idea about whether this would have an impact.

Oh
I understand now.

Give me a few days to look into this.

@teleostnacl
Copy link
Contributor Author

teleostnacl commented Nov 17, 2025

I have another device:

  • OpenWrt Version: OpenWrt SNAPSHOT r31860+1-97256a28fe
  • OpenWrt Target/Subtarget: ramips/mt7621
  • OpenWrt Device: ZTE E8820S
  • Kernel Version: 6.12.57

In this device, I don't select libbpf package, but I also compile tcpreplay failed, and the output like this:

make package/feeds/packages/tcpreplay/compile V=s

make[2]: Entering directory '/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/openwrt/scripts/config'
make[4]: Entering directory '/openwrt/target/linux'
make[5]: Entering directory '/openwrt/target/linux/ramips'
make[6]: Entering directory '/openwrt/target/linux/ramips/image'
make[6]: Leaving directory '/openwrt/target/linux/ramips/image'
make[5]: Leaving directory '/openwrt/target/linux/ramips'
make[4]: Leaving directory '/openwrt/target/linux'
time: target/linux/prereq#1.60#0.26#2.54
make[1]: Entering directory '/openwrt'
+ mkdir -p /openwrt/staging_dir/target-mipsel_24kc_musl
+ cd /openwrt/staging_dir/target-mipsel_24kc_musl
+ mkdir -p bin lib stamp usr/include usr/lib
mkdir -p /openwrt/build_dir/target-mipsel_24kc_musl/stamp
touch /openwrt/staging_dir/target-mipsel_24kc_musl/.prepared
make[2]: Entering directory '/openwrt/package/utils/lua'
make[2]: Leaving directory '/openwrt/package/utils/lua'
time: package/utils/lua/host-compile#0.28#0.07#0.37
make[2]: Entering directory '/openwrt/package/system/apk'
make[2]: Leaving directory '/openwrt/package/system/apk'
time: package/system/apk/host-compile#0.21#0.05#0.26
make[2]: Entering directory '/openwrt/package/libs/toolchain'
echo "libc" >> /openwrt/staging_dir/target-mipsel_24kc_musl/pkginfo/toolchain.default.install
echo "libgcc" >> /openwrt/staging_dir/target-mipsel_24kc_musl/pkginfo/toolchain.default.install
echo "libatomic" >> /openwrt/staging_dir/target-mipsel_24kc_musl/pkginfo/toolchain.default.install
echo "libpthread" >> /openwrt/staging_dir/target-mipsel_24kc_musl/pkginfo/toolchain.default.install
echo "librt" >> /openwrt/staging_dir/target-mipsel_24kc_musl/pkginfo/toolchain.default.install
make[2]: Leaving directory '/openwrt/package/libs/toolchain'
time: package/libs/toolchain/compile#0.17#0.03#0.23
make[2]: Entering directory '/openwrt/feeds/packages/libs/libdnet'
echo "libdnet" >> /openwrt/staging_dir/target-mipsel_24kc_musl/pkginfo/libdnet.default.install
make[2]: Leaving directory '/openwrt/feeds/packages/libs/libdnet'
time: package/feeds/packages/libdnet/compile#0.16#0.04#0.21
make[2]: Entering directory '/openwrt/package/libs/libpcap'
echo "libpcap" >> /openwrt/staging_dir/target-mipsel_24kc_musl/pkginfo/libpcap.default.install
make[2]: Leaving directory '/openwrt/package/libs/libpcap'
time: package/libs/libpcap/compile#0.22#0.03#0.27
make[2]: Entering directory '/openwrt/package/libs/musl-fts'
echo "musl-fts" >> /openwrt/staging_dir/target-mipsel_24kc_musl/pkginfo/musl-fts.default.install
make[2]: Leaving directory '/openwrt/package/libs/musl-fts'
time: package/libs/musl-fts/compile#0.37#0.06#0.44
make[2]: Entering directory '/openwrt/feeds/packages/net/tcpreplay'
rm -rf /openwrt/build_dir/target-mipsel_24kc_musl/tcpreplay-4.5.2/ipkg-mipsel_24kc/tcpbridge
mkdir -p /openwrt/bin/targets/ramips/mt7621/packages /openwrt/build_dir/target-mipsel_24kc_musl/tcpreplay-4.5.2/ipkg-mipsel_24kc/tcpbridge /openwrt/staging_dir/target-mipsel_24kc_musl/pkginfo
install -d -m0755 /openwrt/build_dir/target-mipsel_24kc_musl/tcpreplay-4.5.2/ipkg-mipsel_24kc/tcpbridge/usr/bin ; cp -fpR /openwrt/build_dir/target-mipsel_24kc_musl/tcpreplay-4.5.2/ipkg-install/usr/bin/tcpbridge /openwrt/build_dir/target-mipsel_24kc_musl/tcpreplay-4.5.2/ipkg-mipsel_24kc/tcpbridge/usr/bin
find /openwrt/build_dir/target-mipsel_24kc_musl/tcpreplay-4.5.2/ipkg-mipsel_24kc/tcpbridge -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf
Package tcpbridge is missing dependencies for the following libraries:
libbpf.so.1
make[2]: *** [Makefile:169: /openwrt/bin/packages/mipsel_24kc/packages/tcpbridge-4.5.2-r1.apk] Error 1
make[2]: Leaving directory '/openwrt/feeds/packages/net/tcpreplay'
time: package/feeds/packages/tcpreplay/compile#0.24#0.05#0.30
    ERROR: package/feeds/packages/tcpreplay failed to build.
make[1]: *** [package/Makefile:187: package/feeds/packages/tcpreplay/compile] Error 1
make[1]: Leaving directory '/openwrt'
make: *** [/openwrt/include/toplevel.mk:233: package/feeds/packages/tcpreplay/compile] Error 2

It also tells me Package tcpbridge is missing dependencies for the following libraries:libbpf.so.1, so I think maybe there are other reasons here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants