commit:     d5b5288d2eda333a283575c184c61f062cea7918
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 17 00:08:32 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 17 00:09:06 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5b5288d

net-libs/libnids: don't inline exported functions

Closes: https://bugs.gentoo.org/818517
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../libnids/files/libnids-1.24-no-inline.patch     | 43 ++++++++++++++++++++++
 ...bnids-1.24-r7.ebuild => libnids-1.24-r8.ebuild} | 18 ++++-----
 2 files changed, 52 insertions(+), 9 deletions(-)

diff --git a/net-libs/libnids/files/libnids-1.24-no-inline.patch 
b/net-libs/libnids/files/libnids-1.24-no-inline.patch
new file mode 100644
index 00000000000..8a57c6354d3
--- /dev/null
+++ b/net-libs/libnids/files/libnids-1.24-no-inline.patch
@@ -0,0 +1,43 @@
+https://src.fedoraproject.org/rpms/libnids/raw/rawhide/f/libnids-1.24-inline.patch
+https://bugs.gentoo.org/818517
+
+Patch by Robert Scheck <rob...@fedoraproject.org> for libnids <= 1.24 which
+avoids making the functions ip_fast_csum, ip_compute_csum, my_tcp_check and
+my_udp_check inline, see https://github.com/aol/moloch/issues/440 as well.
+
+--- a/src/checksum.c
++++ b/src/checksum.c
+@@ -120,7 +120,7 @@
+   By Jorge Cwik <jo...@laser.satlink.net>, adapted for linux by Arnt
+   Gulbrandsen.
+ */
+-inline u_short ip_fast_csum(u_char * iph, u_int ihl)
++u_short ip_fast_csum(u_char * iph, u_int ihl)
+ {
+   u_int sum;
+   if (dontchksum(((struct ip*)iph)->ip_src.s_addr))
+@@ -191,13 +191,13 @@
+   this routine is used for miscellaneous IP-like checksums, mainly in
+   icmp.c
+ */
+-inline u_short
++u_short
+ ip_compute_csum(u_char * buff, int len)
+ {
+   return (csum_fold(csum_partial(buff, len, 0)));
+ }
+ 
+-inline u_short
++u_short
+ my_tcp_check(struct tcphdr *th, int len, u_int saddr, u_int daddr)
+ {
+   if (dontchksum(saddr))
+@@ -205,7 +205,7 @@
+   return csum_tcpudp_magic(saddr, daddr, len, IPPROTO_TCP,
+                          csum_partial((u_char *)th, len, 0));
+ }
+-inline u_short
++u_short
+ my_udp_check(void *u, int len, u_int saddr, u_int daddr)
+ {
+   if (dontchksum(saddr))

diff --git a/net-libs/libnids/libnids-1.24-r7.ebuild 
b/net-libs/libnids/libnids-1.24-r8.ebuild
similarity index 82%
rename from net-libs/libnids/libnids-1.24-r7.ebuild
rename to net-libs/libnids/libnids-1.24-r8.ebuild
index aec872f3286..a993c8d9129 100644
--- a/net-libs/libnids/libnids-1.24-r7.ebuild
+++ b/net-libs/libnids/libnids-1.24-r8.ebuild
@@ -1,7 +1,8 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
+
 inherit autotools flag-o-matic toolchain-funcs
 
 DESCRIPTION="an implementation of an E-component of Network Intrusion 
Detection System"
@@ -13,20 +14,18 @@ SLOT="1.2"
 KEYWORDS="amd64 ppc x86"
 IUSE="+glib +libnet static-libs"
 
-RDEPEND="
-       !net-libs/libnids:1.1
+RDEPEND="!net-libs/libnids:1.1
        net-libs/libpcap
        glib? ( dev-libs/glib:2 )
-       libnet? ( >=net-libs/libnet-1.1.0-r3 )
-"
-DEPEND="
-       ${RDEPEND}
-       glib? ( virtual/pkgconfig )
-"
+       libnet? ( >=net-libs/libnet-1.1.0-r3 )"
+DEPEND="${RDEPEND}"
+BDEPEND="glib? ( virtual/pkgconfig )"
+
 PATCHES=(
        "${FILESDIR}"/${P}-ldflags.patch
        "${FILESDIR}"/${P}-libdir.patch
        "${FILESDIR}"/${P}-static-libs.patch
+       "${FILESDIR}"/${P}-no-inline.patch
 )
 
 src_prepare() {
@@ -36,6 +35,7 @@ src_prepare() {
 
 src_configure() {
        tc-export AR
+
        append-flags -fno-strict-aliasing
 
        econf \

Reply via email to