From 98a951bb733688bd6c0e8093296f8f11b06b9f6d Mon Sep 17 00:00:00 2001 From: Zhang Yaqi Date: Wed, 17 Jul 2024 11:15:54 +0800 Subject: [PATCH] fix a not defined macro error --- ...t-0010-Fix-a-not-defined-macro-error.patch | 33 +++++++++++++++++++ tcpdump.spec | 9 ++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 backport-0010-Fix-a-not-defined-macro-error.patch diff --git a/backport-0010-Fix-a-not-defined-macro-error.patch b/backport-0010-Fix-a-not-defined-macro-error.patch new file mode 100644 index 0000000..26a30eb --- /dev/null +++ b/backport-0010-Fix-a-not-defined-macro-error.patch @@ -0,0 +1,33 @@ +From bfc96b04831641376636337406aae7fe0fe65081 Mon Sep 17 00:00:00 2001 +From: Francois-Xavier Le Bail +Date: Wed, 6 Mar 2024 21:11:42 +0100 +Subject: [PATCH] Capsicum support: Fix a 'not defined' macro error + +Reference: https://github.com/the-tcpdump-group/tcpdump/commit/bfc96b04831641376636337406aae7fe0fe65081.patch + +The error was: +In file included from ./tcpdump.c:158: +./interface.h:62:32: error: "HAVE_CAPSICUM" is not defined, evaluates +to 0 [-Werror=undef] + 62 | (defined(HAVE_BPF_DUMP) && HAVE_CAPSICUM && !defined(bpf_dump)) + | +--- + interface.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/interface.h b/interface.h +index 58e5ab3..c631c14 100644 +--- a/interface.h ++++ b/interface.h +@@ -63,7 +63,7 @@ struct bpf_program; + * With Capsicum bpf_dump() may be not declared even if HAVE_BPF_DUMP is set. + */ + #if !defined(HAVE_BPF_DUMP) || \ +- (defined(HAVE_BPF_DUMP) && HAVE_CAPSICUM && !defined(bpf_dump)) ++ (defined(HAVE_BPF_DUMP) && defined(HAVE_CAPSICUM) && !defined(bpf_dump)) + extern void bpf_dump(const struct bpf_program *, int); + + #endif +-- +2.27.0 + diff --git a/tcpdump.spec b/tcpdump.spec index 011c87e..f6a90ed 100644 --- a/tcpdump.spec +++ b/tcpdump.spec @@ -3,7 +3,7 @@ Name: tcpdump Epoch: 14 Version: 4.99.3 -Release: 4 +Release: 5 Summary: A network traffic monitoring tool License: BSD with advertising URL: http://www.tcpdump.org @@ -18,6 +18,7 @@ Patch2: backport-0007-Introduce-nn-option.patch Patch3: backport-0009-Change-n-flag-to-nn-in-TESTonce.patch Patch4: tcpdump-Add-sw64-architecture.patch Patch5: backport-CVE-2023-1801.patch +Patch6: backport-0010-Fix-a-not-defined-macro-error.patch Requires(pre): shadow-utils BuildRequires: automake openssl-devel libpcap-devel git-core gcc make @@ -89,6 +90,12 @@ make check %{_mandir}/man8/tcpdump.8* %changelog +* Wed Jul 17 2024 zhangyaqi - 14:4.99.3-5 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix a not defined macro error + * Sat Apr 20 2024 xinghe - 14:4.99.3-4 - Type:bugfix - ID:NA -- Gitee