summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/tcpreplay
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-support/tcpreplay')
-rw-r--r--meta-networking/recipes-support/tcpreplay/tcpreplay/0001-Fix-linker-error-for-TX_RING.patch71
-rw-r--r--meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-do-not-run-conftest-in-case-of-cross-co.patch51
-rw-r--r--meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-unify-search-dirs-for-pcap-and-add-lib3.patch82
-rw-r--r--meta-networking/recipes-support/tcpreplay/tcpreplay/0002-fix-incompatible-type-assignment-in-txring.c.patch31
-rw-r--r--meta-networking/recipes-support/tcpreplay/tcpreplay_4.5.1.bb (renamed from meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb)6
5 files changed, 105 insertions, 136 deletions
diff --git a/meta-networking/recipes-support/tcpreplay/tcpreplay/0001-Fix-linker-error-for-TX_RING.patch b/meta-networking/recipes-support/tcpreplay/tcpreplay/0001-Fix-linker-error-for-TX_RING.patch
new file mode 100644
index 0000000000..d8f0ab270c
--- /dev/null
+++ b/meta-networking/recipes-support/tcpreplay/tcpreplay/0001-Fix-linker-error-for-TX_RING.patch
@@ -0,0 +1,71 @@
1From 36e038d9e4047ae42a148f671f18971cc6a68558 Mon Sep 17 00:00:00 2001
2From: "mark.yang" <mark.yang@lge.com>
3Date: Thu, 10 Apr 2025 18:30:52 +0900
4Subject: [PATCH] Fix linker error for TX_RING
5
6Found similar issue in gcc 15 build environment.
7- See more details at: http://errors.yoctoproject.org/Errors/Details/851800/
8```
9TOPDIR/tmp/work/core2-64-oe-linux/tcpreplay/4.5.1/recipe-sysroot-native/usr/bin/x86_64-oe-linux/../../libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/15.0.1/ld: ./common/libcommon.a(sendpacket.o): in function `sendpacket':
10/usr/src/debug/tcpreplay/4.5.1/src/common/sendpacket.c:328:(.text+0x1be): undefined reference to `txring_put'
11TOPDIR/tmp/work/core2-64-oe-linux/tcpreplay/4.5.1/recipe-sysroot-native/usr/bin/x86_64-oe-linux/../../libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/15.0.1/ld: ./common/libcommon.a(sendpacket.o): in function `sendpacket_open_pf':
12/usr/src/debug/tcpreplay/4.5.1/src/common/sendpacket.c:1088:(.text+0x7ea): undefined reference to `txring_init'
13TOPDIR/tmp/work/core2-64-oe-linux/tcpreplay/4.5.1/recipe-sysroot-native/usr/bin/x86_64-oe-linux/../../libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/15.0.1/ld: ./common/libcommon.a(sendpacket.o): in function `sendpacket':
14/usr/src/debug/tcpreplay/4.5.1/src/common/sendpacket.c:328:(.text+0x1be): undefined reference to `txring_put'
15TOPDIR/tmp/work/core2-64-oe-linux/tcpreplay/4.5.1/recipe-sysroot-native/usr/bin/x86_64-oe-linux/../../libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/15.0.1/ld: ./common/libcommon.a(sendpacket.o): in function `sendpacket_open_pf':
16/usr/src/debug/tcpreplay/4.5.1/src/common/sendpacket.c:1088:(.text+0x7ea): undefined reference to `txring_init'
17TOPDIR/tmp/work/core2-64-oe-linux/tcpreplay/4.5.1/recipe-sysroot-native/usr/bin/x86_64-oe-linux/../../libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/15.0.1/ld: ./common/libcommon.a(sendpacket.o): in function `sendpacket':
18/usr/src/debug/tcpreplay/4.5.1/src/common/sendpacket.c:328:(.text+0x1be): undefined reference to `txring_put'
19TOPDIR/tmp/work/core2-64-oe-linux/tcpreplay/4.5.1/recipe-sysroot-native/usr/bin/x86_64-oe-linux/../../libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/15.0.1/ld: ./common/libcommon.a(sendpacket.o): in function `sendpacket_open_pf':
20/usr/src/debug/tcpreplay/4.5.1/src/common/sendpacket.c:1088:(.text+0x7ea): undefined reference to `txring_init'
21```
22- The result of "nm -u txring.o" shows no symbols exist.
23
24- The config.h has HAVE_TX_RING defined but txring.c is not aware of it.
25 txring.c and txring.h include config.h at the beginning.
26
27- This resulted in a successful build in my build environment.
28
29It may
30Fixes #731
31Fixes #904
32
33Upstream-Status: Submitted [https://github.com/appneta/tcpreplay/pull/924]
34Signed-off-by: mark.yang <mark.yang@lge.com>
35---
36 src/common/txring.c | 3 +++
37 src/common/txring.h | 4 ++--
38 2 files changed, 5 insertions(+), 2 deletions(-)
39
40diff --git a/src/common/txring.c b/src/common/txring.c
41index d5768d75..f522893d 100644
42--- a/src/common/txring.c
43+++ b/src/common/txring.c
44@@ -31,6 +31,9 @@
45 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46 */
47
48+#include "defines.h"
49+#include "config.h"
50+
51 #ifdef HAVE_TX_RING
52
53 #include "txring.h"
54diff --git a/src/common/txring.h b/src/common/txring.h
55index 309da84c..3f14cac0 100644
56--- a/src/common/txring.h
57+++ b/src/common/txring.h
58@@ -33,11 +33,11 @@
59
60 #pragma once
61
62-#ifdef HAVE_TX_RING
63-
64 #include "defines.h"
65 #include "config.h"
66
67+#ifdef HAVE_TX_RING
68+
69 #if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
70 #include <net/ethernet.h> /* the L2 protocols */
71 #include <netpacket/packet.h>
diff --git a/meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-do-not-run-conftest-in-case-of-cross-co.patch b/meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-do-not-run-conftest-in-case-of-cross-co.patch
deleted file mode 100644
index 08cb3b88fa..0000000000
--- a/meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-do-not-run-conftest-in-case-of-cross-co.patch
+++ /dev/null
@@ -1,51 +0,0 @@
1From 42f7bbc1ce4913fe2c0bc76293c5445d31690f5d Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Thu, 7 Mar 2024 21:02:07 -0800
4Subject: [PATCH] configure.ac: do not run conftest in case of cross
5 compilation
6
7It'll give us nothing but error like below:
8
9 ./conftest: cannot execute binary file: Exec format error
10 ...
11 ./configure: line 23950: test: -eq: unary operator expected
12
13The version check only has effect on Apple systems. We'd better
14avoid error like above when cross compilation.
15
16Also, in case of cross compilation, instead of having the above
17Exec format error and resulting in unaligned_cv_fail to yes, set
18it directly to yes.
19
20Upstream-Status: Submitted [https://github.com/appneta/tcpreplay/pull/849]
21
22Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
23---
24 configure.ac | 4 ++--
25 1 file changed, 2 insertions(+), 2 deletions(-)
26
27diff --git a/configure.ac b/configure.ac
28index 387219de..15201601 100644
29--- a/configure.ac
30+++ b/configure.ac
31@@ -928,7 +928,7 @@ cat >conftest.c <<EOF
32 EOF
33 ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LPCAPLIB \
34 conftest.c $LIBS >/dev/null 2>&1
35-if test -x conftest ; then
36+if test -x conftest -a "$cross_compiling" != "yes"; then
37 full_libpcap_version=$(LD_LIBRARY_PATH="$LPCAP_LD_LIBRARY_PATH" ./conftest)
38 libpcap_version=$(echo "$full_libpcap_version" | ${CUT} -d' ' -f3)
39 pcap_version_ok=yes
40@@ -1709,7 +1709,7 @@ case "$host_os" in
41 EOF
42 ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \
43 conftest.c $LIBS >/dev/null 2>&1
44- if test ! -x conftest ; then
45+ if test ! -x conftest -o "$cross_compiling" = "yes" ; then
46 dnl failed to compile for some reason
47 unaligned_cv_fail=yes
48 else
49--
502.42.0
51
diff --git a/meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-unify-search-dirs-for-pcap-and-add-lib3.patch b/meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-unify-search-dirs-for-pcap-and-add-lib3.patch
deleted file mode 100644
index 709d2cccbc..0000000000
--- a/meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-unify-search-dirs-for-pcap-and-add-lib3.patch
+++ /dev/null
@@ -1,82 +0,0 @@
1From 5f8c78362b3b1e06f5adff2d4b140509c4799894 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Sun, 3 Sep 2023 12:31:59 +0200
4Subject: [PATCH] configure.ac: unify search dirs for pcap and add lib32
5
6* add lib32 because when building lib32-tcpreplay it's
7 impossible to set --with-libpcap so that it would find
8 both include files as well as the library in lib32 directory
9
10* maybe it would be beneficial to split --with-libpcap
11 into --with-libpcap-includedir --with-libpcap-libdir as this
12 already searches in the --with-libpcap value with and
13 without any "lib" prefix, but include files always expect
14 "include" dir there
15
16* most of this code was added in:
17 https://github.com/appneta/tcpreplay/commit/202b8e82f9fd3c84ce5804577caeb36a33baabe7#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810R570
18
19* then search for
20 ${host_cpu} lib/${host_cpu} (without -${host_os} suffix)
21 and ${build_arch}-${host_os} lib/${build_arch}-${host_os}
22 was added, but only for search of dynamic library in:
23 https://github.com/appneta/tcpreplay/commit/c3d5236563985a99f8bb02c3f1bd6950e3929047
24
25* ${build_arch}-${host_os} lib/${build_arch}-${host_os}
26 was later replaced with:
27 lib/${MULTIARCH} ${MULTIARCH}
28 and it was added to static library search as well
29
30 but for dynamic library it was searching in reversed order:
31 ${MULTIARCH} lib/${MULTIARCH}
32 https://github.com/appneta/tcpreplay/commit/ed9e3a818bde04813144014561e62f018c9eb85f
33
34 I don't think this reversed order was intentional, just unify all 4 cases
35 to use the same directories in the same order
36
37Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
38Upstream-Status: Submitted [https://github.com/appneta/tcpreplay/pull/819]
39---
40 configure.ac | 8 ++++----
41 1 file changed, 4 insertions(+), 4 deletions(-)
42
43diff --git a/configure.ac b/configure.ac
44index 387219de..26ba31a5 100644
45--- a/configure.ac
46+++ b/configure.ac
47@@ -671,7 +671,7 @@ AC_ARG_WITH(libpcap,
48 LPCAPINCDIR=${testdir}
49 if test $dynamic_link = yes; then
50 for ext in .dylib .so .tbd ; do
51- for dir in . lib lib64 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
52+ for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
53 sharefile=$(ls ${testdir}/$dir/libpcap${ext}* 2> /dev/null | sort | head -n1)
54 if test -n "${sharefile}"; then
55 LPCAP_LD_LIBRARY_PATH="$(dirname ${sharefile})"
56@@ -690,7 +690,7 @@ AC_ARG_WITH(libpcap,
57 dnl If dynamic library not found, try static
58 dnl
59 for ext in ${libext} .a .A.tbd ; do
60- for dir in . lib lib64 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
61+ for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
62 staticfile=$(ls ${testdir}/$dir/libpcap${ext} 2> /dev/null | sort | head -n1)
63 if test -n "${staticfile}"; then
64 LPCAPLIB="${staticfile}"
65@@ -771,7 +771,7 @@ AC_ARG_WITH(libpcap,
66 LPCAPINCDIR="${testdir}/include"
67 if test $dynamic_link = yes; then
68 for ext in .dylib .so .tbd; do
69- for dir in . lib lib64 ${host_cpu} lib/${host_cpu} ${host_cpu}-${host_os} lib/${host_cpu}-${host_os} ${MULTIARCH} lib/${MULTIARCH}; do
70+ for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
71 sharefile=$(ls "${testdir}/$dir/libpcap${ext}" 2> /dev/null | sort | head -n1)
72 if test -n "${sharefile}"; then
73 LPCAPLIB="-L$(dirname ${sharefile}) -lpcap"
74@@ -790,7 +790,7 @@ AC_ARG_WITH(libpcap,
75 dnl If dynamic library not found, try static
76 dnl
77 for ext in ${libext} .a .A.tbd ; do
78- for dir in . lib lib64 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
79+ for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
80 staticfile=$(ls "${testdir}/$dir/libpcap${ext}" 2> /dev/null | sort | head -n1)
81 if test -n "${staticfile}"; then
82 LPCAPLIB="${staticfile}"
diff --git a/meta-networking/recipes-support/tcpreplay/tcpreplay/0002-fix-incompatible-type-assignment-in-txring.c.patch b/meta-networking/recipes-support/tcpreplay/tcpreplay/0002-fix-incompatible-type-assignment-in-txring.c.patch
new file mode 100644
index 0000000000..906c30e147
--- /dev/null
+++ b/meta-networking/recipes-support/tcpreplay/tcpreplay/0002-fix-incompatible-type-assignment-in-txring.c.patch
@@ -0,0 +1,31 @@
1From 5615e8f7bbf83f03acacd6d6ba9ff8dc6fdc91df Mon Sep 17 00:00:00 2001
2From: "mark.yang" <mark.yang@lge.com>
3Date: Thu, 10 Apr 2025 18:49:51 +0900
4Subject: [PATCH] fix incompatible type assignment in txring.c
5
6* There is an incompatible type assignment error in txring.c.
7 txring.c:200:12: error: incompatible types when assigning to type 'txring_t' {aka 'struct txring_s'} from type 'txring_t *' {aka 'struct txring_s *'}
8 200 | *txp = (txring_t *)safe_malloc(sizeof(txring_t));
9 | ^
10
11 txp is allocated as txring_t *, so I fixed it.
12
13Upstream-Status: Submitted [https://github.com/appneta/tcpreplay/pull/924]
14Signed-off-by: mark.yang <mark.yang@lge.com>
15---
16 src/common/txring.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/src/common/txring.c b/src/common/txring.c
20index f522893d..b062dac2 100644
21--- a/src/common/txring.c
22+++ b/src/common/txring.c
23@@ -197,7 +197,7 @@ txring_init(int fd, unsigned int mtu)
24 txring_t *txp;
25
26 /* allocate memory for structure and fill it with different stuff*/
27- *txp = (txring_t *)safe_malloc(sizeof(txring_t));
28+ txp = (txring_t *)safe_malloc(sizeof(txring_t));
29 txp->treq = (struct tpacket_req *)safe_malloc(sizeof(struct tpacket_req));
30
31 txring_mkreq(txp->treq, mtu);
diff --git a/meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb b/meta-networking/recipes-support/tcpreplay/tcpreplay_4.5.1.bb
index 26de40a65a..46e06a928e 100644
--- a/meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb
+++ b/meta-networking/recipes-support/tcpreplay/tcpreplay_4.5.1.bb
@@ -9,11 +9,11 @@ LIC_FILES_CHKSUM = "file://docs/LICENSE;md5=10f0474a2f0e5dccfca20f69d6598ad8"
9 9
10SRC_URI = "https://github.com/appneta/${BPN}/releases/download/v${PV}/${BP}.tar.gz \ 10SRC_URI = "https://github.com/appneta/${BPN}/releases/download/v${PV}/${BP}.tar.gz \
11 file://0001-libopts.m4-set-POSIX_SHELL-to-bin-sh.patch \ 11 file://0001-libopts.m4-set-POSIX_SHELL-to-bin-sh.patch \
12 file://0001-configure.ac-unify-search-dirs-for-pcap-and-add-lib3.patch \ 12 file://0001-Fix-linker-error-for-TX_RING.patch \
13 file://0001-configure.ac-do-not-run-conftest-in-case-of-cross-co.patch \ 13 file://0002-fix-incompatible-type-assignment-in-txring.c.patch \
14" 14"
15 15
16SRC_URI[sha256sum] = "44f18fb6d3470ecaf77a51b901a119dae16da5be4d4140ffbb2785e37ad6d4bf" 16SRC_URI[sha256sum] = "2de79bfd67ec92ca9ae2ffb50456dd1d53ff40f3fa71b422c65e8062013c9e85"
17 17
18UPSTREAM_CHECK_URI = "https://github.com/appneta/tcpreplay/releases" 18UPSTREAM_CHECK_URI = "https://github.com/appneta/tcpreplay/releases"
19 19