Compare commits

..

No commits in common. "c10" and "c8" have entirely different histories.
c10 ... c8

8 changed files with 144 additions and 134 deletions

3
.gitignore vendored
View File

@ -1,2 +1 @@
libpcap-1.10.4.tar.gz SOURCES/libpcap-1.9.1.tar.gz
libpcap-1.10.4.tar.gz.sig

1
.libpcap.metadata Normal file
View File

@ -0,0 +1 @@
04d6e619defad5bb17af15f6d2304e79b649786c SOURCES/libpcap-1.9.1.tar.gz

View File

@ -10,19 +10,18 @@ Both should be run only by root, hence manpages for them should be located in
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pcap.3pcap.in b/pcap.3pcap.in diff --git a/pcap.3pcap.in b/pcap.3pcap.in
index 492c227..46a2a4b 100644 index f5a7e0c..f220e68 100644
--- a/pcap.3pcap.in --- a/pcap.3pcap.in
+++ b/pcap.3pcap.in +++ b/pcap.3pcap.in
@@ -1025,8 +1025,8 @@ script or some other configuration script to check whether the libpcap @@ -882,7 +882,7 @@ use an
script or some other configuration script to check whether the libpcap
1.0 APIs are available and use them only if they are. 1.0 APIs are available and use them only if they are.
.SH SEE ALSO .SH SEE ALSO
.BR autoconf (1), -autoconf(1), tcpdump(1), tcpslice(1), pcap-filter(@MAN_MISC_INFO@), pfconfig(8),
-.BR tcpdump (1), +autoconf(1), tcpdump(8), tcpslice(8), pcap-filter(@MAN_MISC_INFO@), pfconfig(8),
-.BR tcpslice (1), usermod(@MAN_ADMIN_COMMANDS@)
+.BR tcpdump (8), .SH AUTHORS
+.BR tcpslice (8), The original authors of libpcap are:
.BR \%pcap-filter (@MAN_MISC_INFO@),
.BR pfconfig (8),
.BR usermod (@MAN_ADMIN_COMMANDS@)
-- --
1.8.3.1 1.8.3.1

View File

@ -12,30 +12,45 @@ path anyway.
--- ---
pcap-config.in | 27 ++++++++------------------- pcap-config.in | 27 ++++++++-------------------
1 file changed, 8 insertions(+), 19 deletions(-) 1 file changed, 8 insertions(+), 19 deletions(-)
--
1.8.3.1
diff --git a/pcap-config.in b/pcap-config.in diff --git a/pcap-config.in b/pcap-config.in
index 6039ef3..72297bf 100644 index 206be3b..75f2c9f 100644
--- a/pcap-config.in --- a/pcap-config.in
+++ b/pcap-config.in +++ b/pcap-config.in
@@ -11,7 +11,6 @@ @@ -7,7 +7,6 @@
prefix="@prefix@" prefix="@prefix@"
exec_prefix="@exec_prefix@" exec_prefix="@exec_prefix@"
includedir="@includedir@" includedir="@includedir@"
-libdir="@libdir@" -libdir="@libdir@"
V_RPATH_OPT="@V_RPATH_OPT@"
LIBS="@LIBS@" LIBS="@LIBS@"
LIBS_STATIC="@LIBS_STATIC@" PACKAGE_NAME="@PACKAGE_NAME@"
VERSION="@PACKAGE_VERSION@" @@ -36,16 +35,6 @@ do
@@ -90,16 +89,16 @@ then esac
shift
done
-if [ "$V_RPATH_OPT" != "" ]
-then
- #
- # If libdir isn't /usr/lib, add it to the run-time linker path.
- #
- if [ "$libdir" != "/usr/lib" ]
- then
- RPATH=$V_RPATH_OPT$libdir
- fi
-fi
if [ "$static" = 1 ]
then
#
@@ -54,16 +43,16 @@ then
# #
if [ "$show_cflags" = 1 -a "$show_libs" = 1 ] if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
then then
- echo "-I$includedir $LPATH -l@PACKAGE_NAME@ $LIBS_STATIC" - echo "-I$includedir -L$libdir -lpcap $LIBS"
+ echo "-lpcap @LIBS@" + echo "-lpcap @LIBS@"
elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ] elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
then then
- echo "-I$includedir $LPATH $LIBS_STATIC" - echo "-I$includedir -L$libdir $LIBS"
+ echo "@LIBS@" + echo "@LIBS@"
elif [ "$show_cflags" = 1 ] elif [ "$show_cflags" = 1 ]
then then
@ -43,20 +58,20 @@ index 6039ef3..72297bf 100644
+ echo "" + echo ""
elif [ "$show_libs" = 1 ] elif [ "$show_libs" = 1 ]
then then
- echo "$LPATH -l@PACKAGE_NAME@ $LIBS_STATIC" - echo "-L$libdir -lpcap $LIBS"
+ echo "-lpcap @LIBS@" + echo "-lpcap @LIBS@"
elif [ "$show_additional_libs" = 1 ] elif [ "$show_additional_libs" = 1 ]
then then
echo "$LIBS_STATIC" echo "$LIBS"
@@ -117,16 +116,16 @@ then @@ -75,15 +64,15 @@ else
# #
if [ "$show_cflags" = 1 -a "$show_libs" = 1 ] if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
then then
- echo "-I$includedir $LPATH -l@PACKAGE_NAME@ $LIBS" - echo "-I$includedir -L$libdir $RPATH -l$PACKAGE_NAME"
+ echo "-lpcap" + echo "-lpcap"
elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ] elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
then then
- echo "-I$includedir $LPATH $LIBS" - echo "-I$includedir"
+ echo "" + echo ""
elif [ "$show_cflags" = 1 ] elif [ "$show_cflags" = 1 ]
then then
@ -64,8 +79,10 @@ index 6039ef3..72297bf 100644
+ echo "" + echo ""
elif [ "$show_libs" = 1 ] elif [ "$show_libs" = 1 ]
then then
- echo "$LPATH -l@PACKAGE_NAME@ $LIBS" - echo "-L$libdir $RPATH -l$PACKAGE_NAME"
+ echo "-lpcap" + echo "-lpcap"
elif [ "$show_additional_libs" = 1 ] fi
then fi
echo "$LIBS" --
1.8.3.1

View File

@ -13,7 +13,7 @@ index 900ebbc..58292c3 100644
--- a/pcap-linux.c --- a/pcap-linux.c
+++ b/pcap-linux.c +++ b/pcap-linux.c
@@ -3197,6 +3197,10 @@ activate_new(pcap_t *handle) @@ -3197,6 +3197,10 @@ activate_new(pcap_t *handle)
} handle->linktype = DLT_LINUX_SLL;
} }
+ /* Hack to make things work on s390 ctc interfaces */ + /* Hack to make things work on s390 ctc interfaces */

View File

@ -0,0 +1,66 @@
From 907070918d5e81a515315b395f334e52589fe0fb Mon Sep 17 00:00:00 2001
From: Guy Harris <guy@alum.mit.edu>
Date: Wed, 18 Dec 2019 15:06:53 -0800
Subject: [PATCH] Check for invalid IPv4 addresses.
This should fix GitHub issue #893.
---
gencode.c | 9 ++++++++-
nametoaddr.c | 9 ++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/gencode.c b/gencode.c
index bdc35e646..040a55315 100644
--- a/gencode.c
+++ b/gencode.c
@@ -6947,11 +6947,15 @@ gen_mcode(compiler_state_t *cstate, const char *s1, const char *s2,
return (NULL);
nlen = __pcap_atoin(s1, &n);
+ if (nlen < 0)
+ bpf_error(cstate, "invalid IPv4 address '%s'", s1);
/* Promote short ipaddr */
n <<= 32 - nlen;
if (s2 != NULL) {
mlen = __pcap_atoin(s2, &m);
+ if (mlen < 0)
+ bpf_error(cstate, "invalid IPv4 address '%s'", s2);
/* Promote short ipaddr */
m <<= 32 - mlen;
if ((n & ~m) != 0)
@@ -7009,8 +7013,11 @@ gen_ncode(compiler_state_t *cstate, const char *s, bpf_u_int32 v, struct qual q)
vlen = __pcap_atodn(s, &v);
if (vlen == 0)
bpf_error(cstate, "malformed decnet address '%s'", s);
- } else
+ } else {
vlen = __pcap_atoin(s, &v);
+ if (vlen < 0)
+ bpf_error(cstate, "invalid IPv4 address '%s'", s);
+ }
switch (q.addr) {
diff --git a/nametoaddr.c b/nametoaddr.c
index 53070a285..13bf4c683 100644
--- a/nametoaddr.c
+++ b/nametoaddr.c
@@ -674,8 +674,15 @@ __pcap_atoin(const char *s, bpf_u_int32 *addr)
len = 0;
for (;;) {
n = 0;
- while (*s && *s != '.')
+ while (*s && *s != '.') {
+ if (n > 25) {
+ /* The result will be > 255 */
+ return -1;
+ }
n = n * 10 + *s++ - '0';
+ }
+ if (n > 255)
+ return -1;
*addr <<= 8;
*addr |= n & 0xff;
len += 8;

View File

@ -1,29 +1,24 @@
Name: libpcap Name: libpcap
Epoch: 14 Epoch: 14
Version: 1.10.4 Version: 1.9.1
Release: 7%{?dist} Release: 5%{?dist}
Summary: A system-independent interface for user-level packet capture Summary: A system-independent interface for user-level packet capture
License: ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC License: BSD with advertising
URL: https://www.tcpdump.org/ URL: http://www.tcpdump.org
BuildRequires: make
BuildRequires: bison BuildRequires: bison
BuildRequires: bluez-libs-devel BuildRequires: bluez-libs-devel
BuildRequires: flex BuildRequires: flex
BuildRequires: gcc
BuildRequires: git BuildRequires: git
BuildRequires: glibc-kernheaders >= 2.2.0 BuildRequires: glibc-kernheaders >= 2.2.0
#rdma-core-devel not available on arm
%ifnarch %{arm}
BuildRequires: rdma-core-devel BuildRequires: rdma-core-devel
%endif
Source0: https://www.tcpdump.org/release/%{name}-%{version}.tar.gz Source: http://www.tcpdump.org/release/%{name}-%{version}.tar.gz
Source1: https://www.tcpdump.org/release/%{name}-%{version}.tar.gz.sig
Patch0001: 0001-man-tcpdump-and-tcpslice-have-manpages-in-man8.patch Patch0001: 0001-man-tcpdump-and-tcpslice-have-manpages-in-man8.patch
Patch0002: 0002-pcap-config-mitigate-multilib-conflict.patch Patch0002: 0002-pcap-config-mitigate-multilib-conflict.patch
Patch0003: 0003-pcap-linux-apparently-ctc-interfaces-on-s390-has-eth.patch Patch0003: 0003-pcap-linux-apparently-ctc-interfaces-on-s390-has-eth.patch
Patch0004: 0004-invalid-IPv4-address.patch
%description %description
Libpcap provides a portable framework for low-level network Libpcap provides a portable framework for low-level network
@ -39,7 +34,7 @@ on your network.
%package devel %package devel
Summary: Libraries and header files for the libpcap library Summary: Libraries and header files for the libpcap library
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name} = %{epoch}:%{version}-%{release}
%description devel %description devel
Libpcap provides a portable framework for low-level network Libpcap provides a portable framework for low-level network
@ -63,26 +58,24 @@ sed -i -e 's|-fpic|-fPIC|g' configure
%build %build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%ifarch %{arm}
%configure
%else
%configure --enable-rdma %configure --enable-rdma
%endif make %{?_smp_mflags}
%make_build
%install %install
%make_install make DESTDIR=$RPM_BUILD_ROOT install
rm -f $RPM_BUILD_ROOT%{_libdir}/libpcap.a rm -f $RPM_BUILD_ROOT%{_libdir}/libpcap.a
%ldconfig_scriptlets %ldconfig_scriptlets
%files %files
%defattr(-,root,root)
%license LICENSE %license LICENSE
%doc README.md CHANGES CREDITS %doc README.md CHANGES CREDITS
%{_libdir}/libpcap.so.* %{_libdir}/libpcap.so.*
%{_mandir}/man7/pcap*.7* %{_mandir}/man7/pcap*.7*
%files devel %files devel
%defattr(-,root,root)
%{_bindir}/pcap-config %{_bindir}/pcap-config
%{_includedir}/pcap*.h %{_includedir}/pcap*.h
%{_includedir}/pcap %{_includedir}/pcap
@ -93,99 +86,36 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libpcap.a
%{_mandir}/man5/pcap*.5* %{_mandir}/man5/pcap*.5*
%changelog %changelog
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 14:1.10.4-7 * Mon Jan 18 2021 Michal Ruprich <mruprich@redhat.com> - 14:1.9.1-5
- Bump release for October 2024 mass rebuild: - Resolves: #1743650 - Enable inbox support for sniffing offloaded RDMA traffic with tcpdump
Resolves: RHEL-64018
* Tue Jul 02 2024 František Hrdina <fhrdina@redhat.com> - 14:1.10.4-6 * Fri May 22 2020 Michal Ruprich <michalruprich@gmail.com> - 14:1.9.1-4
- Fix broken gating - Related: #1806422 - Building libpcap to side-tag for tcpdump
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 14:1.10.4-5 * Fri May 22 2020 Michal Ruprich <michalruprich@gmail.com> - 14:1.9.1-3
- Bump release for June 2024 mass rebuild - Related: #1743650 - reverting rdma changes due to unresolved dependency loop
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.10.4-4 * Wed May 06 2020 Michal Ruprich <michalruprich@gmail.com> - 14:1.9.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - Related: #1806422 - Building libpcap to side-tag for tcpdump
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.10.4-3 * Thu Apr 09 2020 Michal Ruprich <michalruprich@gmail.com> - 14:1.9.1-1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - Resolves: #1806422 - rebase libpcap to version 1.9.1
- Resolves: #1743650 - [RFE] enable inbox support for sniffing offloaded (RDMA) traffic with tcpdump
- Resolves: #1785330 - Invalid IPv4 addresses are accepted without reporting even a warning
- Resolves: #1792208 - Resource exhaustion while PHB header length validation
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.10.4-2 * Wed Jul 03 2019 Michal Ruprich <mruprich@redhat.com> - 14:1.9.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - Resolves: #1708397 - Move libpcap.pc to libpcap-devel
- Removing obsolete group tag
* Wed Apr 12 2023 Michal Ruprich <mruprich@redhat.com> - 14:1.10.4-1 * Wed May 22 2019 Michal Ruprich <mruprich@redhat.com> - 14:1.9.0-2
- New version 1.10.4 - Resolves: #1680929 - libpcap changes blocked until gating tests are added
* Tue Mar 21 2023 Michal Ruprich <mruprich@redhat.com> - 14:1.10.3-3
- SPDX migration
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.10.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Jan 17 2023 Michal Ruprich <mruprich@redhat.com> - 14:1.10.3-1
- New version 1.10.3
* Tue Jan 03 2023 Michal Ruprich <mruprich@redhat.com> - 14:1.10.2-1
- New version 1.10.2
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.10.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.10.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.10.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jun 10 2021 Michal Ruprich <mruprich@redhat.com> - 14:1.10.1-1
- New version 1.10.1
* Thu Feb 11 2021 Michal Ruprich <mruprich@redhat.com> - 14:1.10.0-1
- New version 1.10.0
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.9.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Oct 12 2020 Michal Ruprich <mruprich@redhat.com> - 14:1.9.1-6
- Using make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.9.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri May 15 2020 Michal Ruprich <michalruprich@gmail.com> - 14:1.9.1-4
- Enabling rdma support in libpcap
* Mon Feb 24 2020 Michal Ruprich <mruprich@redhat.com> - 14:1.9.1-3
- libpcap should print an error on wrong IPv4 address
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.9.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Oct 11 2019 Michal Ruprich <mruprich@redhat.com> - 14:1.9.1-1
- New version 1.9.1
- Fix for CVE-2018-16301, CVE-2019-15161, CVE-2019-15162, CVE-2019-15163, CVE-2019-15164, CVE-2019-15165
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.9.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.9.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Aug 13 2018 Peter Robinson <pbrobinson@fedoraproject.org> 14:1.9.0-2
- pkgconfig file belong in devel package
- drop obsolete group in spec
* Wed Aug 01 2018 Michal Ruprich <mruprich@redhat.com> - 14:1.9.0-1 * Wed Aug 01 2018 Michal Ruprich <mruprich@redhat.com> - 14:1.9.0-1
- New version 1.9.0 - New version 1.9.0
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.8.1-11 * Thu Jun 07 2018 Michal Ruprich <mruprich@redhat.com> - 14:1.8.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - Adding support for AF_VSOCK (rhbz#1587833)
* Wed Jun 06 2018 Michal Ruprich <mruprich@redhat.com> - 14:1.8.1-10
- Adding support for AF_VSOCK
* Tue Feb 20 2018 Martin Sehnoutka <msehnout@redhat.com> - 14:1.8.1-9
- Add gcc to BuildRequires
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.8.1-8 * Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 14:1.8.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

View File

@ -1,2 +0,0 @@
SHA512 (libpcap-1.10.4.tar.gz) = 1f6d6ddd07dae7c557054cb246437ecdaf39d579592a5a6bdf1144eea6cb5a779ac4ca647cfed11ec1b0bb18efc63b845444e497070bacefaaed19a5787ae5e1
SHA512 (libpcap-1.10.4.tar.gz.sig) = 34aa401c2e162d708c61b78b445af2fe4ddc0e57de9124b5cc3a05679ffbc3834088160f83892d827e25c65b33313fe71aa73c2de09935d387252ab315ca5ee1