Merge pull request #1394 from flatcar/krnowak/net-libs-automation

Add net-libs packages under automation
This commit is contained in:
Krzesimir Nowak 2023-12-07 12:55:26 +01:00 committed by GitHub
commit 9b63891ef2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 429 additions and 932 deletions

View File

@ -356,11 +356,19 @@ net-firewall/ipset
net-fs/cifs-utils
net-libs/gnutls
net-libs/http-parser
net-libs/libmicrohttpd
net-libs/libmnl
net-libs/libnetfilter_conntrack
net-libs/libnetfilter_cthelper
net-libs/libnetfilter_cttimeout
net-libs/libnetfilter_queue
net-libs/libnfnetlink
net-libs/libnftnl
net-libs/libnsl
net-libs/libpcap
net-libs/libslirp
net-libs/libssh2
net-libs/nghttp2
net-libs/rpcsvc-proto

View File

@ -0,0 +1,5 @@
- libmnl ([1.0.5](https://git.netfilter.org/libmnl/log/?h=libmnl-1.0.5))
- libnetfilter_conntrack ([1.0.9](https://git.netfilter.org/libnetfilter_conntrack/log/?h=libnetfilter_conntrack-1.0.9))
- libnetfilter_cthelper ([1.0.1](https://git.netfilter.org/libnetfilter_cthelper/log/?id=8cee0347cc6969c39bb64000dfaa676a8f9e30f0))
- libnetfilter_cttimeout ([1.0.1](https://git.netfilter.org/libnetfilter_cttimeout/log/?id=068d36d6291f53a0a609ab1f695aa06e94ce3d30))
- libnfnetlink ([1.0.2](https://git.netfilter.org/libnfnetlink/log/?h=libnfnetlink-1.0.2))

View File

@ -63,8 +63,8 @@
=net-libs/gnutls-3.8.0 ~arm64
# Keep versions on both arches in sync.
=net-libs/libnetfilter_cthelper-1.0.0-r1 ~arm64
=net-libs/libnetfilter_cttimeout-1.0.0-r1 ~arm64
=net-libs/libnetfilter_cthelper-1.0.1-r1 ~arm64
=net-libs/libnetfilter_cttimeout-1.0.1 ~arm64
# Required to allow us to override the sftp subsystem in sshd config.
=net-misc/openssh-9.4_p1 ~amd64 ~arm64

View File

@ -1,8 +1,9 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit toolchain-funcs multilib-minimal
EAPI=8
inherit toolchain-funcs
DESCRIPTION="HTTP request/response parser for C"
HOMEPAGE="https://github.com/nodejs/http-parser"
@ -12,26 +13,26 @@ LICENSE="MIT"
# 2.9.4 restored ABI compatibility with 2.9.0 but since we failed
# to set subslot in 2.9.3, we want to provoke another rebuild
SLOT="0/2.9.4"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x64-macos ~x64-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x64-macos ~x64-solaris"
PATCHES=(
"${FILESDIR}"/${P}-non-x86-test.patch
)
src_prepare() {
default
src_configure() {
tc-export CC AR
multilib_copy_sources
}
multilib_src_compile() {
src_compile() {
emake PREFIX="${EPREFIX}/usr" LIBDIR="${EPREFIX}/usr/$(get_libdir)" CFLAGS_FAST="${CFLAGS}" library
}
multilib_src_test() {
src_test() {
emake CFLAGS_DEBUG="${CFLAGS}" CFLAGS_FAST="${CFLAGS}" test
}
multilib_src_install() {
src_install() {
emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" LIBDIR="${EPREFIX}/usr/$(get_libdir)" install
einstalldocs
}

View File

@ -1 +1,2 @@
DIST libmnl-1.0.4.tar.bz2 301270 BLAKE2B e24ae3e7a8bcfe35a04256c495bb3e9a5ec41b6bea9b7ffa0a8ebc82ce847921d4a44e5be3558239fee5008c10541a9ac3614d1a6b80d280b632a76da16be5e8 SHA512 e2bbfb688fe41913d53c74ba7ec95b4e88ee2c52b556b8608185f2fcbd629665423a3b37f877f84426ba257cf6040fa701539d67166b00b8e3e2dfde6831a2f9
DIST libmnl-1.0.5.tar.bz2 314791 BLAKE2B 760ec6f7eaf3f2c6be6edf848551e4c7d16ae7cbe49f9cde297f5df06174fb7f9f490118942225558f0a89dabe9a4901c1b3b23fa1203132e36b86e6332564d6 SHA512 16fa48e74c9da7724a85c655dfb0abd8369392627934639d65de951543e1447ac3e048d231248f1ce8861443c2ef62654a85a81feeedbbffaf2e5744f6cf4c9f
DIST libmnl-1.0.5.tar.bz2.sig 566 BLAKE2B 4454f969cbc21f86c12905eb80dd7237f368bbb30e38202ef114edf77806091cda164870e825aca4305a925077d181662724412f8475866c7fbe2572b0b1da50 SHA512 bb75ae3b5520d8b9372d70da7c1a27fa3d8e50a26a05fe56397dead4d7d5ad4003e6e576becd1200a5c9ed42fe5a97273acc8c50f1fd3181688f0d0b8c607dfc

View File

@ -1,33 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit usr-ldscript
DESCRIPTION="Minimalistic netlink library"
HOMEPAGE="https://netfilter.org/projects/libmnl/"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2"
LICENSE="LGPL-2.1"
SLOT="0/0.2.0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux"
IUSE="examples static-libs"
src_configure() {
econf $(use_enable static-libs static)
}
src_install() {
default
gen_usr_ldscript -a mnl
find "${D}" -name '*.la' -delete || die
if use examples; then
find examples/ -name 'Makefile*' -delete || die
dodoc -r examples/
docompress -x /usr/share/doc/${PF}/examples
fi
}

View File

@ -0,0 +1,32 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/netfilter.org.asc
inherit verify-sig
DESCRIPTION="Minimalistic netlink library"
HOMEPAGE="https://netfilter.org/projects/libmnl/"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2
verify-sig? ( https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2.sig )"
LICENSE="LGPL-2.1"
SLOT="0/0.2.0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux"
IUSE="examples"
DEPEND="elibc_musl? ( sys-libs/queue-standalone )"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-netfilter )"
src_install() {
default
find "${ED}" -name '*.la' -delete || die
if use examples; then
find examples/ -name 'Makefile*' -delete || die
dodoc -r examples/
docompress -x /usr/share/doc/${PF}/examples
fi
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>netmon@gentoo.org</email>

View File

@ -1,2 +1,2 @@
DIST libnetfilter_conntrack-1.0.8.tar.bz2 331750 BLAKE2B 614f8d80863d6f7d8110b5faf68debe3a9ba0c6737f02fa0de9d0e53d30771581becb052e7cd990b0632e9264cb9cdeb2af26a41e2b1ab9421218ec616e1f8d8 SHA512 ddc70e7e3f2d764ed1e115e4a03fe8848b8c04bd69eea0952e63131dd4dae3c23f33b8be518673e1ec3b5dbf708f5f86eac97be46fe265d95386a5e902bd0b82
DIST libnetfilter_conntrack-1.0.9.tar.bz2 373177 BLAKE2B 701393338a0bf852b97d80a1e4ab078dea741f7181246b3dafcbe8cff287b5b9fae72c1c50867ea71baab83fa842471b2c7054fb4702bf35900a352078de8f3a SHA512 e8b03425aaba3b72e6034c215656c34176d0550c08e0455aaeb1365d9141505d0c4feaa8978c8ccf2b7af9db6c9e874ceb866347e533b41cb03a189884f4004c
DIST libnetfilter_conntrack-1.0.9.tar.bz2.sig 566 BLAKE2B 0f80f00858093ed5e9aac190fbb1ac5ac1dde60e6767b65adda49ed79fb7fb6cc7caea51793d8930a927d9b7a75d263851dd5741d6d408a8b56d3ea5b73da20e SHA512 83ed38f68bd38cf70d9c245a7f17373751ff9099ceff3066812b282b7426edf2eee79da8f5aea896b119327059008ff4a531b3dfdcd79d49944bea4079e67e1f

View File

@ -0,0 +1,16 @@
https://bugzilla.netfilter.org/show_bug.cgi?id=1654
--- a/configure.ac
+++ b/configure.ac
@@ -55,9 +55,9 @@ int main()
struct in6_addr addr6;
char buf[128];
if (inet_ntop(AF_INET6, &addr6, buf, 128) == 0 && errno == EAFNOSUPPORT)
- exit(1);
+ return 1;
else
- exit(0);
+ return 0;
}
]])],[ AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(HAVE_INET_NTOP_IPV6, 1, [Define to 1 if inet_ntop supports IPv6.])

View File

@ -1,43 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit linux-info
DESCRIPTION="Programming interface (API) to the in-kernel connection tracking state table"
HOMEPAGE="https://www.netfilter.org/projects/libnetfilter_conntrack/"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="static-libs"
RDEPEND="
>=net-libs/libmnl-1.0.3
>=net-libs/libnfnetlink-1.0.0
"
DEPEND="
${RDEPEND}
virtual/pkgconfig
"
DOCS=( README )
pkg_setup() {
linux-info_pkg_setup
if kernel_is lt 2 6 18 ; then
die "${PN} requires at least 2.6.18 kernel version"
fi
# netfilter core team has changed some option names with kernel 2.6.20
if kernel_is lt 2 6 20 ; then
CONFIG_CHECK="~IP_NF_CONNTRACK_NETLINK"
else
CONFIG_CHECK="~NF_CT_NETLINK"
fi
check_extra_config
}

View File

@ -0,0 +1,59 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools linux-info verify-sig
DESCRIPTION="Programming interface (API) to the in-kernel connection tracking state table"
HOMEPAGE="https://www.netfilter.org/projects/libnetfilter_conntrack/"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2
verify-sig? ( https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2.sig )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/netfilter.org.asc
RDEPEND=">=net-libs/libmnl-1.0.3
>=net-libs/libnfnetlink-1.0.0"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig
verify-sig? ( sec-keys/openpgp-keys-netfilter )"
DOCS=( README )
PATCHES=(
"${FILESDIR}"/${P}-musl.patch
"${FILESDIR}"/${PN}-1.0.9-configure-clang16.patch
)
pkg_setup() {
linux-info_pkg_setup
if kernel_is lt 2 6 18 ; then
die "${PN} requires at least 2.6.18 kernel version"
fi
# netfilter core team has changed some option names with kernel 2.6.20
if kernel_is lt 2 6 20 ; then
CONFIG_CHECK="~IP_NF_CONNTRACK_NETLINK"
else
CONFIG_CHECK="~NF_CT_NETLINK"
fi
check_extra_config
}
src_prepare() {
default
# autoreconf only for clang 16 configure patch
eautoreconf
}
src_install() {
default
find "${ED}" -name '*.la' -delete || die
}

View File

@ -1,22 +1,25 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit linux-info
inherit linux-info verify-sig
DESCRIPTION="Programming interface (API) to the in-kernel connection tracking state table"
HOMEPAGE="https://www.netfilter.org/projects/libnetfilter_conntrack/"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2
verify-sig? ( https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2.sig )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/netfilter.org.asc
RDEPEND=">=net-libs/libmnl-1.0.3
>=net-libs/libnfnetlink-1.0.0"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"
BDEPEND="virtual/pkgconfig
verify-sig? ( sec-keys/openpgp-keys-netfilter )"
DOCS=( README )

View File

@ -1 +1,2 @@
DIST libnetfilter_cthelper-1.0.0.tar.bz2 275229 BLAKE2B 622a4e27629d97a0ab2b5032e972914f2ab8764ab60ab7090b173ceabfe9648e09452e931dacb822090c5f816b553b8e73b8f8a4ee431db9f6dd092d9d4283ee SHA512 f0372daee0edbf4c27ee80eadd4ce786a4b67b39c0b9d22e88bc9adcbdffd6676eb9df01b933ee64d2fcea9c05a9ca9070c94e907277d69acbd22ae9a3c74e45
DIST libnetfilter_cthelper-1.0.1.tar.bz2 291739 BLAKE2B cc5ae85dca896c0b8b1b704e0c5cc201677f48c2765520dc992a1b218d1334e04c592ba48cf06efe32a5089c7ad70fa44cbb2b40f2e8400d7ef9d2976a6425ee SHA512 f0591edd579aee92b62446e2b8fef6af9c404848c42c8da76850bb01aec3567442612f53cf8d3af6ba4d6d920487bff310a4e547bccf595478b1f96b4280eada
DIST libnetfilter_cthelper-1.0.1.tar.bz2.sig 566 BLAKE2B 2904ddbe9bea0ea4a126bdd286a0d3eaf8e850e49cb3cb0ec196d424bbf91b89abe8ada8c1c5db29b5764c2d003de1212885a9f6676fee454237801ba02bc5a4 SHA512 991f1e20673eb290fc9b4b35c5dd0c27223398e560f4807b5497fc6b69780594cbae026481dbdf1862a25da7537f60b7d938038a8310cf3b0cd207ca1d3672e6

View File

@ -1,387 +0,0 @@
fix from upstream
From f58c5b09fb59baf07c942d373fc4d522b27e73c6 Mon Sep 17 00:00:00 2001
From: Kevin Cernekee <cernekee@chromium.org>
Date: Wed, 4 Jan 2017 14:30:26 -0800
Subject: [PATCH] Use __EXPORTED rather than EXPORT_SYMBOL
clang is sensitive to the ordering of
__attribute__((visibility("default"))) relative to the function
body. gcc is not. So if we try to re-declare an existing function
with default visibility, clang prints a warning and generates
a broken .so file in which nfct_helper_* are not exported to library
callers.
Move the attribute up into the function definition to make clang happy.
Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
doxygen.cfg.in | 2 +-
src/internal.h | 5 ++-
src/libnetfilter_cthelper.c | 83 ++++++++++++++++++---------------------------
3 files changed, 36 insertions(+), 54 deletions(-)
diff --git a/doxygen.cfg.in b/doxygen.cfg.in
index cac9b0510b4d..190b7cd6e716 100644
--- a/doxygen.cfg.in
+++ b/doxygen.cfg.in
@@ -72,7 +72,7 @@ RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */.git/* .*.d
-EXCLUDE_SYMBOLS = EXPORT_SYMBOL
+EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
diff --git a/src/internal.h b/src/internal.h
index 3a88d1a1f7d8..5d781718ddad 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -3,10 +3,9 @@
#include "config.h"
#ifdef HAVE_VISIBILITY_HIDDEN
-# define __visible __attribute__((visibility("default")))
-# define EXPORT_SYMBOL(x) typeof(x) (x) __visible
+# define __EXPORTED __attribute__((visibility("default")))
#else
-# define EXPORT_SYMBOL
+# define __EXPORTED
#endif
#endif
diff --git a/src/libnetfilter_cthelper.c b/src/libnetfilter_cthelper.c
index f8f58e6c9c5e..af543a17fafa 100644
--- a/src/libnetfilter_cthelper.c
+++ b/src/libnetfilter_cthelper.c
@@ -99,17 +99,16 @@ struct nfct_helper {
* In case of success, this function returns a valid pointer, otherwise NULL
* s returned and errno is appropriately set.
*/
-struct nfct_helper *nfct_helper_alloc(void)
+struct nfct_helper __EXPORTED *nfct_helper_alloc(void)
{
return calloc(1, sizeof(struct nfct_helper));
}
-EXPORT_SYMBOL(nfct_helper_alloc);
/**
* nfct_helper_free - release one helper object
* \param nfct_helper pointer to the helper object
*/
-void nfct_helper_free(struct nfct_helper *h)
+void __EXPORTED nfct_helper_free(struct nfct_helper *h)
{
int i;
@@ -119,7 +118,6 @@ void nfct_helper_free(struct nfct_helper *h)
}
free(h);
}
-EXPORT_SYMBOL(nfct_helper_free);
/**
* nfct_helper_policy_alloc - allocate a new helper policy object
@@ -127,21 +125,19 @@ EXPORT_SYMBOL(nfct_helper_free);
* In case of success, this function returns a valid pointer, otherwise NULL
* s returned and errno is appropriately set.
*/
-struct nfct_helper_policy *nfct_helper_policy_alloc(void)
+struct nfct_helper_policy __EXPORTED *nfct_helper_policy_alloc(void)
{
return calloc(1, sizeof(struct nfct_helper_policy));
}
-EXPORT_SYMBOL(nfct_helper_policy_alloc);
/**
* nfct_helper_free - release one helper policy object
* \param nfct_helper pointer to the helper object
*/
-void nfct_helper_policy_free(struct nfct_helper_policy *p)
+void __EXPORTED nfct_helper_policy_free(struct nfct_helper_policy *p)
{
free(p);
}
-EXPORT_SYMBOL(nfct_helper_policy_free);
/**
* nfct_helper_policy_attr_set - set one attribute of the helper object
@@ -149,7 +145,7 @@ EXPORT_SYMBOL(nfct_helper_policy_free);
* \param type attribute type you want to set
* \param data pointer to data that will be used to set this attribute
*/
-void
+void __EXPORTED
nfct_helper_policy_attr_set(struct nfct_helper_policy *p,
enum nfct_helper_policy_attr_type type,
const void *data)
@@ -170,7 +166,6 @@ nfct_helper_policy_attr_set(struct nfct_helper_policy *p,
break;
}
}
-EXPORT_SYMBOL(nfct_helper_policy_attr_set);
/**
* nfct_helper_attr_set_str - set one attribute the helper object
@@ -178,23 +173,21 @@ EXPORT_SYMBOL(nfct_helper_policy_attr_set);
* \param type attribute type you want to set
* \param name string that will be used to set this attribute
*/
-void
+void __EXPORTED
nfct_helper_policy_attr_set_str(struct nfct_helper_policy *p,
enum nfct_helper_policy_attr_type type,
const char *name)
{
nfct_helper_policy_attr_set(p, type, name);
}
-EXPORT_SYMBOL(nfct_helper_policy_attr_set_str);
-void
+void __EXPORTED
nfct_helper_policy_attr_set_u32(struct nfct_helper_policy *p,
enum nfct_helper_policy_attr_type type,
uint32_t value)
{
nfct_helper_policy_attr_set(p, type, &value);
}
-EXPORT_SYMBOL(nfct_helper_policy_attr_set_u32);
/**
* nfct_helper_attr_set - set one attribute of the helper object
@@ -202,7 +195,7 @@ EXPORT_SYMBOL(nfct_helper_policy_attr_set_u32);
* \param type attribute type you want to set
* \param data pointer to data that will be used to set this attribute
*/
-void
+void __EXPORTED
nfct_helper_attr_set(struct nfct_helper *h,
enum nfct_helper_attr_type type, const void *data)
{
@@ -250,7 +243,6 @@ nfct_helper_attr_set(struct nfct_helper *h,
break;
}
}
-EXPORT_SYMBOL(nfct_helper_attr_set);
/**
* nfct_helper_attr_set_str - set one attribute the helper object
@@ -258,44 +250,40 @@ EXPORT_SYMBOL(nfct_helper_attr_set);
* \param type attribute type you want to set
* \param name string that will be used to set this attribute
*/
-void
+void __EXPORTED
nfct_helper_attr_set_str(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type,
const char *name)
{
nfct_helper_attr_set(nfct_helper, type, name);
}
-EXPORT_SYMBOL(nfct_helper_attr_set_str);
-void
+void __EXPORTED
nfct_helper_attr_set_u8(struct nfct_helper *nfct_helper,
enum nfct_helper_attr_type type, uint8_t value)
{
nfct_helper_attr_set(nfct_helper, type, &value);
}
-EXPORT_SYMBOL(nfct_helper_attr_set_u8);
-void
+void __EXPORTED
nfct_helper_attr_set_u16(struct nfct_helper *nfct_helper,
enum nfct_helper_attr_type type, uint16_t value)
{
nfct_helper_attr_set(nfct_helper, type, &value);
}
-EXPORT_SYMBOL(nfct_helper_attr_set_u16);
-void
+void __EXPORTED
nfct_helper_attr_set_u32(struct nfct_helper *nfct_helper,
enum nfct_helper_attr_type type, uint32_t value)
{
nfct_helper_attr_set(nfct_helper, type, &value);
}
-EXPORT_SYMBOL(nfct_helper_attr_set_u32);
/**
* nfct_helper_attr_unset - unset one attribute the helper object
* \param nfct_helper pointer to the helper object
* \param type attribute type you want to set
*/
-void
+void __EXPORTED
nfct_helper_attr_unset(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
{
switch(type) {
@@ -307,7 +295,6 @@ nfct_helper_attr_unset(struct nfct_helper *nfct_helper, enum nfct_helper_attr_ty
break;
}
}
-EXPORT_SYMBOL(nfct_helper_attr_unset);
/**
* nfct_helper_attr_get - get one attribute the helper object
@@ -317,8 +304,9 @@ EXPORT_SYMBOL(nfct_helper_attr_unset);
* This function returns a valid pointer to the attribute data. If a
* unsupported attribute is used, this returns NULL.
*/
-const void *nfct_helper_attr_get(struct nfct_helper *helper,
- enum nfct_helper_attr_type type)
+const void __EXPORTED *
+nfct_helper_attr_get(struct nfct_helper *helper,
+ enum nfct_helper_attr_type type)
{
const void *ret = NULL;
@@ -358,7 +346,6 @@ const void *nfct_helper_attr_get(struct nfct_helper *helper,
}
return ret;
}
-EXPORT_SYMBOL(nfct_helper_attr_get);
/**
* nfct_helper_attr_get_str - get one attribute the helper object
@@ -368,13 +355,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get);
* This function returns a valid pointer to the beginning of the string.
* If the attribute is unsupported, this returns NULL.
*/
-const char *
+const char __EXPORTED *
nfct_helper_attr_get_str(struct nfct_helper *nfct_helper,
enum nfct_helper_attr_type type)
{
return (const char *)nfct_helper_attr_get(nfct_helper, type);
}
-EXPORT_SYMBOL(nfct_helper_attr_get_str);
/**
* nfct_helper_attr_get_u8 - get one attribute the helper object
@@ -384,12 +370,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get_str);
* This function returns a unsigned 8-bits integer. If the attribute is
* unsupported, this returns NULL.
*/
-uint8_t nfct_helper_attr_get_u8(struct nfct_helper *nfct_helper,
- enum nfct_helper_attr_type type)
+uint8_t __EXPORTED
+nfct_helper_attr_get_u8(struct nfct_helper *nfct_helper,
+ enum nfct_helper_attr_type type)
{
return *((uint8_t *)nfct_helper_attr_get(nfct_helper, type));
}
-EXPORT_SYMBOL(nfct_helper_attr_get_u8);
/**
* nfct_helper_attr_get_u16 - get one attribute the helper object
@@ -399,12 +385,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get_u8);
* This function returns a unsigned 16-bits integer. If the attribute is
* unsupported, this returns NULL.
*/
-uint16_t nfct_helper_attr_get_u16(struct nfct_helper *nfct_helper,
- enum nfct_helper_attr_type type)
+uint16_t __EXPORTED
+nfct_helper_attr_get_u16(struct nfct_helper *nfct_helper,
+ enum nfct_helper_attr_type type)
{
return *((uint16_t *)nfct_helper_attr_get(nfct_helper, type));
}
-EXPORT_SYMBOL(nfct_helper_attr_get_u16);
/**
* nfct_helper_attr_get_u32 - get one attribute the helper object
@@ -414,12 +400,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get_u16);
* This function returns a unsigned 32-bits integer. If the attribute is
* unsupported, this returns NULL.
*/
-uint32_t nfct_helper_attr_get_u32(struct nfct_helper *nfct_helper,
- enum nfct_helper_attr_type type)
+uint32_t __EXPORTED
+nfct_helper_attr_get_u32(struct nfct_helper *nfct_helper,
+ enum nfct_helper_attr_type type)
{
return *((uint32_t *)nfct_helper_attr_get(nfct_helper, type));
}
-EXPORT_SYMBOL(nfct_helper_attr_get_u32);
/**
* nfct_helper_snprintf - print helper object into one buffer
@@ -431,9 +417,10 @@ EXPORT_SYMBOL(nfct_helper_attr_get_u32);
* This function returns -1 in case that some mandatory attributes are
* missing. On sucess, it returns 0.
*/
-int nfct_helper_snprintf(char *buf, size_t size,
- struct nfct_helper *helper,
- unsigned int type, unsigned int flags)
+int __EXPORTED
+nfct_helper_snprintf(char *buf, size_t size,
+ struct nfct_helper *helper,
+ unsigned int type, unsigned int flags)
{
int ret;
@@ -454,7 +441,6 @@ int nfct_helper_snprintf(char *buf, size_t size,
return ret;
}
-EXPORT_SYMBOL(nfct_helper_snprintf);
/**
* @}
@@ -490,7 +476,7 @@ EXPORT_SYMBOL(nfct_helper_snprintf);
* - Command NFNL_MSG_ACCT_DEL, to delete one specific nfct_helper object (if
* unused, otherwise you hit EBUSY).
*/
-struct nlmsghdr *
+struct nlmsghdr __EXPORTED *
nfct_helper_nlmsg_build_hdr(char *buf, uint8_t cmd,
uint16_t flags, uint32_t seq)
{
@@ -509,7 +495,6 @@ nfct_helper_nlmsg_build_hdr(char *buf, uint8_t cmd,
return nlh;
}
-EXPORT_SYMBOL(nfct_helper_nlmsg_build_hdr);
static void
nfct_helper_nlmsg_build_policy(struct nlmsghdr *nlh,
@@ -530,7 +515,7 @@ nfct_helper_nlmsg_build_policy(struct nlmsghdr *nlh,
* \param nlh: netlink message that you want to use to add the payload.
* \param nfct_helper: pointer to a helper object
*/
-void
+void __EXPORTED
nfct_helper_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfct_helper *h)
{
struct nlattr *nest;
@@ -593,7 +578,6 @@ nfct_helper_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfct_helper *h)
if (h->bitset & (1 << NFCTH_ATTR_STATUS))
mnl_attr_put_u32(nlh, NFCTH_STATUS, ntohl(h->status));
}
-EXPORT_SYMBOL(nfct_helper_nlmsg_build_payload);
static int
nfct_helper_nlmsg_parse_tuple_cb(const struct nlattr *attr, void *data)
@@ -795,7 +779,7 @@ nfct_helper_nlmsg_parse_attr_cb(const struct nlattr *attr, void *data)
* This function returns -1 in case that some mandatory attributes are
* missing. On sucess, it returns 0.
*/
-int
+int __EXPORTED
nfct_helper_nlmsg_parse_payload(const struct nlmsghdr *nlh,
struct nfct_helper *h)
{
@@ -832,7 +816,6 @@ nfct_helper_nlmsg_parse_payload(const struct nlmsghdr *nlh,
}
return 0;
}
-EXPORT_SYMBOL(nfct_helper_nlmsg_parse_payload);
/**
* @}
--
2.11.0

View File

@ -1,29 +1,35 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit linux-info
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/netfilter.org.asc
inherit linux-info verify-sig
DESCRIPTION="Userspace library for interface to user-space helper for conntrack"
HOMEPAGE="https://www.netfilter.org/projects/libnetfilter_cthelper/"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2
verify-sig? ( https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2.sig )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ppc ppc64 ~riscv x86"
BDEPEND="virtual/pkgconfig"
RDEPEND="net-libs/libmnl:="
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${P}-clang-export.patch
)
BDEPEND="virtual/pkgconfig
verify-sig? ( sec-keys/openpgp-keys-netfilter )"
CONFIG_CHECK="~NF_CT_NETLINK_HELPER"
pkg_setup() {
linux-info_pkg_setup
kernel_is lt 3 6 0 && ewarn "requires at least 3.6.0 kernel version"
}
src_install() {
default
find "${ED}" -name '*.la' -delete || die
}

View File

@ -1 +1,2 @@
DIST libnetfilter_cttimeout-1.0.0.tar.bz2 275065 BLAKE2B 8b0f952bcd4184141a434abe25f807ad07bb74713a3506d335c5368ddce2809596c77e5e534337d897fb6268afa137f6d98cfd314b0b33b4996e4a0df4d8eba6 SHA512 d64f592be022d02b6e6627470f9aed75114b0c7177012d31d868ee7eb39fca330a7638c9a209ff489d4a8c0549b8fcfd33582c6d36ee519b920cf27429301c85
DIST libnetfilter_cttimeout-1.0.1.tar.bz2 292649 BLAKE2B b51d631ee6b4c3bb34cf1394e2a3216a6ac4d89773bafecd058b31bdf78bf5eb255d3cb2539ca591f64c95cdf7f0db720a5b78e90009e0c7c208219ed454686f SHA512 3f7886b2b8c67fb45d9f6d03f8a327d0f04072abf75ec0fa310f4a321a1749607e79b48f47c8b8488f9833734689419264afada0cbc1f0360a5ae9e17d4a1100
DIST libnetfilter_cttimeout-1.0.1.tar.bz2.sig 566 BLAKE2B eecbb2c7453ab1db598c4e02e7a0d5c29d68cb2788537ce22783bc0856ed6f6c64d66cdd9e2438fa901ebaf1c5dcad6b3a816678de2410cd414a5bf387f8ced0 SHA512 da491294392d94ddf7f1267607bc631ffc564a9e21b439b60a13b7d1259b7a80bc0d4f70208a79f0b674c26ac434c924216775bbe968d56bce5f3fa587eef3fb

View File

@ -1,266 +0,0 @@
fix from upstream
From d0c4e39d12f903e06db262656cff2e24d267bed7 Mon Sep 17 00:00:00 2001
From: Kevin Cernekee <cernekee@chromium.org>
Date: Wed, 4 Jan 2017 14:30:25 -0800
Subject: [PATCH] Use __EXPORTED rather than EXPORT_SYMBOL
clang is sensitive to the ordering of
__attribute__((visibility("default"))) relative to the function
body. gcc is not. So if we try to re-declare an existing function
with default visibility, clang prints a warning and generates
a broken .so file in which nfct_timeout_* are not exported to library
callers.
Move the attribute up into the function definition to make clang happy.
Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
doxygen.cfg.in | 2 +-
src/internal.h | 5 ++---
src/libnetfilter_cttimeout.c | 44 +++++++++++++++++---------------------------
3 files changed, 20 insertions(+), 31 deletions(-)
diff --git a/doxygen.cfg.in b/doxygen.cfg.in
index 8e5d4495eb41..09c3ce00e422 100644
--- a/doxygen.cfg.in
+++ b/doxygen.cfg.in
@@ -72,7 +72,7 @@ RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */.git/* .*.d
-EXCLUDE_SYMBOLS = EXPORT_SYMBOL nfct_timeout _container_policy_cb
+EXCLUDE_SYMBOLS = nfct_timeout _container_policy_cb
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
diff --git a/src/internal.h b/src/internal.h
index 3a88d1a1f7d8..5d781718ddad 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -3,10 +3,9 @@
#include "config.h"
#ifdef HAVE_VISIBILITY_HIDDEN
-# define __visible __attribute__((visibility("default")))
-# define EXPORT_SYMBOL(x) typeof(x) (x) __visible
+# define __EXPORTED __attribute__((visibility("default")))
#else
-# define EXPORT_SYMBOL
+# define __EXPORTED
#endif
#endif
diff --git a/src/libnetfilter_cttimeout.c b/src/libnetfilter_cttimeout.c
index 7844a1f9c19a..a0a71851b0eb 100644
--- a/src/libnetfilter_cttimeout.c
+++ b/src/libnetfilter_cttimeout.c
@@ -187,7 +187,7 @@ struct nfct_timeout {
* In case of success, this function returns a valid pointer, otherwise NULL
* s returned and errno is appropriately set.
*/
-struct nfct_timeout *nfct_timeout_alloc(void)
+struct nfct_timeout __EXPORTED *nfct_timeout_alloc(void)
{
struct nfct_timeout *t;
@@ -197,19 +197,17 @@ struct nfct_timeout *nfct_timeout_alloc(void)
return t;
}
-EXPORT_SYMBOL(nfct_timeout_alloc);
/**
* nfct_timeout_free - release one conntrack timeout object
* \param t pointer to the conntrack timeout object
*/
-void nfct_timeout_free(struct nfct_timeout *t)
+void __EXPORTED nfct_timeout_free(struct nfct_timeout *t)
{
if (t->timeout)
free(t->timeout);
free(t);
}
-EXPORT_SYMBOL(nfct_timeout_free);
/**
* nfct_timeout_attr_set - set one attribute of the conntrack timeout object
@@ -217,7 +215,7 @@ EXPORT_SYMBOL(nfct_timeout_free);
* \param type attribute type you want to set
* \param data pointer to data that will be used to set this attribute
*/
-int
+int __EXPORTED
nfct_timeout_attr_set(struct nfct_timeout *t, uint32_t type, const void *data)
{
switch(type) {
@@ -236,7 +234,6 @@ nfct_timeout_attr_set(struct nfct_timeout *t, uint32_t type, const void *data)
t->attrset |= (1 << type);
return 0;
}
-EXPORT_SYMBOL(nfct_timeout_attr_set);
/**
* nfct_timeout_attr_set_u8 - set one attribute of the conntrack timeout object
@@ -244,12 +241,11 @@ EXPORT_SYMBOL(nfct_timeout_attr_set);
* \param type attribute type you want to set
* \param data pointer to data that will be used to set this attribute
*/
-int
+int __EXPORTED
nfct_timeout_attr_set_u8(struct nfct_timeout *t, uint32_t type, uint8_t data)
{
return nfct_timeout_attr_set(t, type, &data);
}
-EXPORT_SYMBOL(nfct_timeout_attr_set_u8);
/**
* nfct_timeout_attr_set_u16 - set one attribute of the conntrack timeout object
@@ -257,23 +253,21 @@ EXPORT_SYMBOL(nfct_timeout_attr_set_u8);
* \param type attribute type you want to set
* \param data pointer to data that will be used to set this attribute
*/
-int
+int __EXPORTED
nfct_timeout_attr_set_u16(struct nfct_timeout *t, uint32_t type, uint16_t data)
{
return nfct_timeout_attr_set(t, type, &data);
}
-EXPORT_SYMBOL(nfct_timeout_attr_set_u16);
/**
* nfct_timeout_attr_unset - unset one attribute of the conntrack timeout object
* \param t pointer to the conntrack timeout object
* \param type attribute type you want to set
*/
-void nfct_timeout_attr_unset(struct nfct_timeout *t, uint32_t type)
+void __EXPORTED nfct_timeout_attr_unset(struct nfct_timeout *t, uint32_t type)
{
t->attrset &= ~(1 << type);
}
-EXPORT_SYMBOL(nfct_timeout_attr_unset);
/**
* nfct_timeout_policy_attr_set_u32 - set one attribute of the policy
@@ -281,7 +275,7 @@ EXPORT_SYMBOL(nfct_timeout_attr_unset);
* \param type attribute type you want to set
* \param data data that will be used to set this attribute
*/
-int
+int __EXPORTED
nfct_timeout_policy_attr_set_u32(struct nfct_timeout *t,
uint32_t type, uint32_t data)
{
@@ -319,18 +313,17 @@ nfct_timeout_policy_attr_set_u32(struct nfct_timeout *t,
return 0;
}
-EXPORT_SYMBOL(nfct_timeout_policy_attr_set_u32);
/**
* nfct_timeout_policy_attr_unset - unset one attribute of the policy
* \param t pointer to the conntrack timeout object
* \param type attribute type you want to set
*/
-void nfct_timeout_policy_attr_unset(struct nfct_timeout *t, uint32_t type)
+void __EXPORTED
+nfct_timeout_policy_attr_unset(struct nfct_timeout *t, uint32_t type)
{
t->attrset &= ~(1 << type);
}
-EXPORT_SYMBOL(nfct_timeout_policy_attr_unset);
/**
* nfct_timeout_policy_attr_to_name - get state name from protocol state number
@@ -340,7 +333,8 @@ EXPORT_SYMBOL(nfct_timeout_policy_attr_unset);
* This function returns NULL if unsupported protocol or state number is passed.
* Otherwise, a pointer to valid string is returned.
*/
-const char *nfct_timeout_policy_attr_to_name(uint8_t l4proto, uint32_t state)
+const char __EXPORTED *
+nfct_timeout_policy_attr_to_name(uint8_t l4proto, uint32_t state)
{
if (timeout_protocol[l4proto].state_to_name == NULL) {
printf("no array state name\n");
@@ -354,7 +348,6 @@ const char *nfct_timeout_policy_attr_to_name(uint8_t l4proto, uint32_t state)
return timeout_protocol[l4proto].state_to_name[state];
}
-EXPORT_SYMBOL(nfct_timeout_policy_attr_to_name);
/**
* @}
@@ -438,8 +431,9 @@ nfct_timeout_snprintf_default(char *buf, size_t size,
* This function returns -1 in case that some mandatory attributes are
* missing. On sucess, it returns 0.
*/
-int nfct_timeout_snprintf(char *buf, size_t size, const struct nfct_timeout *t,
- unsigned int type, unsigned int flags)
+int __EXPORTED
+nfct_timeout_snprintf(char *buf, size_t size, const struct nfct_timeout *t,
+ unsigned int type, unsigned int flags)
{
int ret = 0;
@@ -454,7 +448,6 @@ int nfct_timeout_snprintf(char *buf, size_t size, const struct nfct_timeout *t,
return ret;
}
-EXPORT_SYMBOL(nfct_timeout_snprintf);
/**
* @}
@@ -477,7 +470,7 @@ EXPORT_SYMBOL(nfct_timeout_snprintf);
* - CTNL_MSG_TIMEOUT_GET: get conntrack timeout object.
* - CTNL_MSG_TIMEOUT_DEL: delete conntrack timeout object.
*/
-struct nlmsghdr *
+struct nlmsghdr __EXPORTED *
nfct_timeout_nlmsg_build_hdr(char *buf, uint8_t cmd,
uint16_t flags, uint32_t seq)
{
@@ -496,14 +489,13 @@ nfct_timeout_nlmsg_build_hdr(char *buf, uint8_t cmd,
return nlh;
}
-EXPORT_SYMBOL(nfct_timeout_nlmsg_build_hdr);
/**
* nfct_timeout_nlmsg_build_payload - build payload from ct timeout object
* \param nlh: netlink message that you want to use to add the payload.
* \param t: pointer to a conntrack timeout object
*/
-void
+void __EXPORTED
nfct_timeout_nlmsg_build_payload(struct nlmsghdr *nlh,
const struct nfct_timeout *t)
{
@@ -532,7 +524,6 @@ nfct_timeout_nlmsg_build_payload(struct nlmsghdr *nlh,
}
}
-EXPORT_SYMBOL(nfct_timeout_nlmsg_build_payload);
static int
timeout_nlmsg_parse_attr_cb(const struct nlattr *attr, void *data)
@@ -629,7 +620,7 @@ timeout_parse_attr_data(struct nfct_timeout *t, const struct nlattr *nest)
* This function returns -1 in case that some mandatory attributes are
* missing. On sucess, it returns 0.
*/
-int
+int __EXPORTED
nfct_timeout_nlmsg_parse_payload(const struct nlmsghdr *nlh,
struct nfct_timeout *t)
{
@@ -654,7 +645,6 @@ nfct_timeout_nlmsg_parse_payload(const struct nlmsghdr *nlh,
}
return 0;
}
-EXPORT_SYMBOL(nfct_timeout_nlmsg_parse_payload);
/**
* @}
--
2.11.0

View File

@ -1,25 +1,24 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit linux-info
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/netfilter.org.asc
inherit linux-info verify-sig
DESCRIPTION="netlink interface for conntrack timeout infrastructure in kernel's packet filter"
HOMEPAGE="https://www.netfilter.org/projects/libnetfilter_cttimeout/"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2
verify-sig? ( https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2.sig )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ppc ppc64 ~riscv x86"
BDEPEND="virtual/pkgconfig"
RDEPEND="net-libs/libmnl:="
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${P}-clang-export.patch
)
BDEPEND="virtual/pkgconfig
verify-sig? ( sec-keys/openpgp-keys-netfilter )"
CONFIG_CHECK="~NF_CT_NETLINK_TIMEOUT"
@ -27,3 +26,9 @@ pkg_setup() {
linux-info_pkg_setup
kernel_is lt 3 4 0 && ewarn "requires at least 3.4.0 kernel version"
}
src_install() {
default
find "${ED}" -name '*.la' -delete || die
}

View File

@ -1,3 +1,2 @@
DIST libnetfilter_queue-1.0.3.tar.bz2 314857 BLAKE2B c25b0395b13af3cecb960c39bcbc4f10a3f203aad7acaeb277346423310700d9abb5b8a65f27b008e5f45194aa6e0fd6a99c8ad25a1e3200904be70c5c6ddaa4 SHA512 1d9e0202878bc0ae26ceecd0f4fa4c21f89056e5671d46949f92f21c155d589958b7775760fc837547da34eb9a81e537e95c770d25c166e709dad16de4ca452e
DIST libnetfilter_queue-1.0.4.tar.bz2 312699 BLAKE2B 29d553c36af551cbaa3b1b4382ad38d6ea7402efafa5ff4ae99c6f05d0ddd15d24b007a4ccdcbc21b8bd9cea28859668a27a6fae4e6534f68dea79d6d0a02789 SHA512 5d81d8e8190a80c9b42bc851a87cc4f749709803b8c9964508013bafb033f1b51b65222a244885f321a2be90517c6a636533ff72b653935a2b8d819560a51187
DIST libnetfilter_queue-1.0.5.tar.bz2 313856 BLAKE2B 0d7806fd23961f6b80f6ef63faf0fe10307a34495337a7f6dd4f0eb76b5ba8a96292b86285e0740f83414417810e47f47b1400c7d83fb4d8fc6f58954f4bd9df SHA512 732a44b602e5efaa4f5582ea25ff8f5ec8f4dca5c0e725cd93fe2d441db80416b25c6018147be90acb262d7428eb5b21b3f7b5920e612d115061ec6a19d67f85
DIST libnetfilter_queue-1.0.5.tar.bz2.sig 590 BLAKE2B d8b5b3ae82fe2722db8a0c200a75146b70f79b7eafb34ddba8349f7f38f02eb5546eee9ae31920f5b7301787a2866a908199b69f8465fe1b6e45ebdc5fb7ae13 SHA512 65558652c7d54087eb1b5a37f7574bcca3495e5ee6587c7b555a7fe6e118007cf9431a66ed5280ce272890c659eb171570e0d0cbb733cf969ae8b44a1d541687

View File

@ -1,29 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit linux-info
DESCRIPTION="API to packets that have been queued by the kernel packet filter"
HOMEPAGE="https://www.netfilter.org/projects/libnetfilter_queue/"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~mips ppc ppc64 ~sparc x86"
IUSE="static-libs"
RDEPEND="
>=net-libs/libmnl-1.0.3
>=net-libs/libnfnetlink-0.0.41
"
DEPEND="
${RDEPEND}
virtual/pkgconfig
"
CONFIG_CHECK="~NETFILTER_NETLINK_QUEUE"
pkg_setup() {
linux-info_pkg_setup
kernel_is lt 2 6 14 && ewarn "requires at least 2.6.14 kernel version"
}

View File

@ -1,39 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit linux-info
DESCRIPTION="API to packets that have been queued by the kernel packet filter"
HOMEPAGE="https://www.netfilter.org/projects/libnetfilter_queue/"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
IUSE="static-libs"
RDEPEND="
>=net-libs/libmnl-1.0.3
>=net-libs/libnfnetlink-0.0.41
"
DEPEND="
${RDEPEND}
"
BDEPEND="
app-doc/doxygen
virtual/pkgconfig
"
CONFIG_CHECK="~NETFILTER_NETLINK_QUEUE"
pkg_setup() {
linux-info_pkg_setup
kernel_is lt 2 6 14 && ewarn "requires at least 2.6.14 kernel version"
}
src_prepare() {
default
# hack for script that was not distributed
[[ -x fixmanpages.sh ]] || ln -s $(type -P true) fixmanpages.sh
}

View File

@ -1,17 +1,19 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit linux-info
inherit linux-info verify-sig
DESCRIPTION="API to packets that have been queued by the kernel packet filter"
HOMEPAGE="https://www.netfilter.org/projects/libnetfilter_queue/"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2"
SRC_URI="https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2
verify-sig? ( https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2.sig )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~mips ppc ppc64 ~riscv ~sparc x86"
IUSE="doc static-libs"
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/netfilter.org.asc
RDEPEND="
>=net-libs/libmnl-1.0.3
@ -23,6 +25,7 @@ DEPEND="
BDEPEND="
doc? ( app-doc/doxygen )
virtual/pkgconfig
verify-sig? ( sec-keys/openpgp-keys-netfilter )
"
CONFIG_CHECK="~NETFILTER_NETLINK_QUEUE"

View File

@ -1,2 +1,2 @@
DIST 04aef8a4dedf267dd5744afb134ef8046e77f613-musl-fix-includes.patch 677 BLAKE2B 189c57ffc8eeb6a83e46fd1d53390e977294f7d3a269d3ffab07e1fce04083a7b4b956e93e02f4f81ce6db4ec5be785b16d1c75ed7e0b4fef9883154d9407e18 SHA512 fc452e2924fa4de66e104229bc05a663c253148fb1c0bd62e5454a907877ffb084ba6a04e38bf4ef71a4e58041f4a242001a8029aefbe97ccc00e3bfcb7bba41
DIST libnfnetlink-1.0.1.tar.bz2 320641 BLAKE2B 18d6f702afffa1bf2cb6978426f4a1aeab8692a288686c099eb7dfabff23648b4b0f1ac14b4661f16e3d50b6e7d29090d58ce715dac107acb12648e93c5df4f3 SHA512 2ec2cd389c04e21c8a02fb3f6d6f326fc33ca9589577f1739c23d883fe2ee9feaa16e83b6ed09063ad886432e49565dc3256277d035260aca5aab17954b46104
DIST libnfnetlink-1.0.2.tar.bz2 298844 BLAKE2B 81c954f6ca2738b321e9319d20741aa15376e88e5f7a0ce1cfa2b02cd104f98d020ab6206bfbc79fc66655f8e40a17bfb65cbce0b1684d9373b809de5a433fc4 SHA512 a5e9ae22831f1d17703f83953f3b0ef898e8b3fa7f0f771b038db51816ddae3158574380ac4d45c09fb8fbb8677e2ccdcc5c4736e3b09de06eac99f899130854
DIST libnfnetlink-1.0.2.tar.bz2.sig 566 BLAKE2B 9e87fc7917dd2f8b29de642ef819bca957bd6223417e167e21770450ce2eeff717ab06079ac75c689184f9188e785b663fca81cdda30b87310bfb1b456b03dd2 SHA512 3dcb980fb209c9faa9774f0393bc3b4b5fa6e899330f0d0dcb92307984f696b869de27c22dd54d7f181bddd72e104b38e8617af6bb3d6fe992a96da172b10457

View File

@ -1,24 +1,22 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit linux-info
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/netfilter.org.asc
inherit linux-info verify-sig
PATCH_BLOB=04aef8a4dedf267dd5744afb134ef8046e77f613
PATCH_FN=${PATCH_BLOB}-musl-fix-includes.patch
DESCRIPTION="the low-level library for netfilter related kernel/userspace communication"
DESCRIPTION="The low-level library for netfilter related kernel/userspace communication"
HOMEPAGE="http://www.netfilter.org/projects/libnfnetlink/"
SRC_URI="
http://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2
https://git.alpinelinux.org/cgit/aports/plain/main/libnfnetlink/musl-fix-includes.patch -> ${PATCH_FN}"
https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2
verify-sig? ( https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2.sig )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
PATCHES=( "${DISTDIR}/${PATCH_FN}" )
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-netfilter )"
pkg_setup() {
linux-info_pkg_setup
@ -40,13 +38,15 @@ pkg_setup() {
check_extra_config
}
src_configure() {
econf --disable-static
src_unpack() {
default
use verify-sig && verify-sig_verify_detached "${DISTDIR}"/${P}.tar.bz2{,.sig}
}
src_install() {
default
# no static archives
find "${D}" -name '*.la' -delete || die
# No static archives
find "${ED}" -name '*.la' -delete || die
}

View File

@ -1 +1 @@
DIST libssh2-1.10.0.tar.gz 965044 BLAKE2B 0e6f571cc723e0050bf7ba7492f361ef222547dcbc311019cb6762f01405b4906e0418207a7d484c5170bee5e6f666827a7ea0d0cf233f684f999f896ce0b415 SHA512 e064ee1089eb8e6cd5fa2617f4fd8ff56c2721c5476775a98bdb68c6c4ee4d05c706c3bb0eb479a27a8ec0b17a8a5ef43e1d028ad3f134519aa582d3981a3a30
DIST libssh2-1.11.0.tar.xz 686796 BLAKE2B 36903798c72f7261d9e997254169c10a4e69166017445276de8b0066fff15cd4dae4119a8d6cbbab8859d765b2d7f34f2911bbaf83c8d6ac5d1feead6b5de64e SHA512 6d50c71b778ca0f769fcc9d2cc257ab669cd0b6c35e8b0e047b6b38aea10638974cc591ba27c25bb7dd523020b4a8a62e2c1ae368287d9dc254d5e24d4a7cee7

View File

@ -0,0 +1,10 @@
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -63,7 +63,6 @@ if(SH_EXECUTABLE)
mark_as_advanced(SSHD_EXECUTABLE)
endif()
- add_test(NAME mansyntax COMMAND ${SH_EXECUTABLE} -c "${CMAKE_CURRENT_SOURCE_DIR}/mansyntax.sh")
endif()
add_library(runner STATIC ${librunner_la_SOURCES})

View File

@ -0,0 +1,95 @@
https://bugs.gentoo.org/911279
Upstream: https://github.com/libssh2/libssh2/issues/1053
Commit: https://github.com/libssh2/libssh2/commit/1153ebdeba563ac657b525edd6bf6da68b1fe5e2
From: Viktor Szakats <commit@vsz.me>
Date: Tue, 30 May 2023 17:28:03 +0000
Subject: [PATCH] mbedtls: use more `size_t` to sync up with `crypto.h`
Ref: 5a96f494ee0b00282afb2db2e091246fc5e1774a #846 #879
Fixes #1053
Closes #1054
--- a/src/mbedtls.c
+++ b/src/mbedtls.c
@@ -186,7 +186,7 @@ _libssh2_mbedtls_cipher_dtor(_libssh2_cipher_ctx *ctx)
int
_libssh2_mbedtls_hash_init(mbedtls_md_context_t *ctx,
mbedtls_md_type_t mdtype,
- const unsigned char *key, unsigned long keylen)
+ const unsigned char *key, size_t keylen)
{
const mbedtls_md_info_t *md_info;
int ret, hmac;
@@ -221,7 +221,7 @@ _libssh2_mbedtls_hash_final(mbedtls_md_context_t *ctx, unsigned char *hash)
}
int
-_libssh2_mbedtls_hash(const unsigned char *data, unsigned long datalen,
+_libssh2_mbedtls_hash(const unsigned char *data, size_t datalen,
mbedtls_md_type_t mdtype, unsigned char *hash)
{
const mbedtls_md_info_t *md_info;
@@ -497,8 +497,9 @@ int
_libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx,
size_t hash_len,
const unsigned char *sig,
- unsigned long sig_len,
- const unsigned char *m, unsigned long m_len)
+ size_t sig_len,
+ const unsigned char *m,
+ size_t m_len)
{
int ret;
int md_type;
@@ -548,8 +549,9 @@ _libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx,
int
_libssh2_mbedtls_rsa_sha1_verify(libssh2_rsa_ctx * rsactx,
const unsigned char *sig,
- unsigned long sig_len,
- const unsigned char *m, unsigned long m_len)
+ size_t sig_len,
+ const unsigned char *m,
+ size_t m_len)
{
return _libssh2_mbedtls_rsa_sha2_verify(rsactx, SHA_DIGEST_LENGTH,
sig, sig_len, m, m_len);
--- a/src/mbedtls.h
+++ b/src/mbedtls.h
@@ -478,12 +478,12 @@ _libssh2_mbedtls_cipher_dtor(_libssh2_cipher_ctx *ctx);
int
_libssh2_mbedtls_hash_init(mbedtls_md_context_t *ctx,
mbedtls_md_type_t mdtype,
- const unsigned char *key, unsigned long keylen);
+ const unsigned char *key, size_t keylen);
int
_libssh2_mbedtls_hash_final(mbedtls_md_context_t *ctx, unsigned char *hash);
int
-_libssh2_mbedtls_hash(const unsigned char *data, unsigned long datalen,
+_libssh2_mbedtls_hash(const unsigned char *data, size_t datalen,
mbedtls_md_type_t mdtype, unsigned char *hash);
_libssh2_bn *
@@ -526,9 +526,8 @@ _libssh2_mbedtls_rsa_new_private_frommemory(libssh2_rsa_ctx **rsa,
int
_libssh2_mbedtls_rsa_sha1_verify(libssh2_rsa_ctx *rsa,
const unsigned char *sig,
- unsigned long sig_len,
- const unsigned char *m,
- unsigned long m_len);
+ size_t sig_len,
+ const unsigned char *m, size_t m_len);
int
_libssh2_mbedtls_rsa_sha1_sign(LIBSSH2_SESSION *session,
libssh2_rsa_ctx *rsa,
@@ -540,8 +539,8 @@ int
_libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx,
size_t hash_len,
const unsigned char *sig,
- unsigned long sig_len,
- const unsigned char *m, unsigned long m_len);
+ size_t sig_len,
+ const unsigned char *m, size_t m_len);
int
_libssh2_mbedtls_rsa_sha2_sign(LIBSSH2_SESSION *session,
libssh2_rsa_ctx *rsa,

View File

@ -1,41 +0,0 @@
--- a/tests/mansyntax.sh
+++ b/tests/mansyntax.sh
@@ -1,37 +1,2 @@
#!/bin/sh
-set -e
-
-# Written by Mikhail Gusarov
-#
-# Run syntax checks for all manpages in the documentation tree.
-#
-
-srcdir=${srcdir:-$PWD}
-dstdir=${builddir:-$PWD}
-mandir=${srcdir}/../docs
-
-#
-# Only test if suitable man is available
-#
-if ! man --help | grep -q warnings; then
- echo "man version not suitable, skipping tests"
- exit 0
-fi
-
-ec=0
-
-trap "rm -f $dstdir/man3" EXIT
-
-ln -sf "$mandir" "$dstdir/man3"
-
-for manpage in $mandir/libssh2_*.*; do
- echo "$manpage"
- warnings=$(LANG=en_US.UTF-8 MANWIDTH=80 man -M "$dstdir" --warnings \
- -E UTF-8 -l "$manpage" 2>&1 >/dev/null)
- if [ -n "$warnings" ]; then
- echo "$warnings"
- ec=1
- fi
-done
-
-exit $ec
+:

View File

@ -1,21 +1,20 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_ECLASS=cmake
EAPI=8
inherit cmake-multilib
DESCRIPTION="Library implementing the SSH2 protocol"
HOMEPAGE="https://www.libssh2.org"
SRC_URI="https://www.libssh2.org/download/${P}.tar.gz"
SRC_URI="https://www.libssh2.org/download/${P}.tar.xz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-solaris"
IUSE="gcrypt mbedtls zlib"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
IUSE="gcrypt mbedtls test zlib"
REQUIRED_USE="?? ( gcrypt mbedtls )"
# Tests try to set containers up using docker (and fail for some reason).
RESTRICT="test"
RESTRICT="!test? ( test )"
RDEPEND="
gcrypt? ( >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] )
@ -31,6 +30,10 @@ DEPEND="
${RDEPEND}
"
PATCHES=(
"${FILESDIR}"/${PN}-1.11.0-mansyntax_sh.patch
)
multilib_src_configure() {
local crypto_backend=OpenSSL
if use gcrypt; then
@ -41,13 +44,22 @@ multilib_src_configure() {
local mycmakeargs=(
-DBUILD_SHARED_LIBS=ON
-DBUILD_TESTING=$(usex test)
-DCRYPTO_BACKEND=${crypto_backend}
-DENABLE_ZLIB_COMPRESSION=$(usex zlib)
)
if use test ; then
# Pass separately to avoid unused var warnings w/ USE=-test
mycmakeargs+=(
-DRUN_SSHD_TESTS=OFF
-DRUN_DOCKER_TESTS=OFF
)
fi
cmake_src_configure
}
multilib_src_install_all() {
einstalldocs
find "${ED}" -name '*.la' -delete || die
}

View File

@ -0,0 +1,66 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake-multilib
DESCRIPTION="Library implementing the SSH2 protocol"
HOMEPAGE="https://www.libssh2.org"
SRC_URI="https://www.libssh2.org/download/${P}.tar.xz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
IUSE="gcrypt mbedtls test zlib"
REQUIRED_USE="?? ( gcrypt mbedtls )"
RESTRICT="!test? ( test )"
RDEPEND="
gcrypt? ( >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] )
!gcrypt? (
mbedtls? ( net-libs/mbedtls:0=[${MULTILIB_USEDEP}] )
!mbedtls? (
>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
)
)
zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
"
DEPEND="
${RDEPEND}
"
PATCHES=(
"${FILESDIR}"/${PN}-1.11.0-mansyntax_sh.patch
"${FILESDIR}"/${PN}-1.11.0-size_t.patch
)
multilib_src_configure() {
local crypto_backend=OpenSSL
if use gcrypt; then
crypto_backend=Libgcrypt
elif use mbedtls; then
crypto_backend=mbedTLS
fi
local mycmakeargs=(
-DBUILD_SHARED_LIBS=ON
-DBUILD_TESTING=$(usex test)
-DCRYPTO_BACKEND=${crypto_backend}
-DENABLE_ZLIB_COMPRESSION=$(usex zlib)
)
if use test ; then
# Pass separately to avoid unused var warnings w/ USE=-test
mycmakeargs+=(
-DRUN_SSHD_TESTS=OFF
-DRUN_DOCKER_TESTS=OFF
)
fi
cmake_src_configure
}
multilib_src_install_all() {
einstalldocs
}

View File

@ -1,9 +1,9 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_ECLASS=cmake
inherit git-r3 cmake-multilib
EAPI=8
inherit cmake-multilib git-r3
DESCRIPTION="Library implementing the SSH2 protocol"
HOMEPAGE="https://www.libssh2.org"
@ -12,9 +12,9 @@ EGIT_REPO_URI="https://github.com/libssh2/libssh2"
LICENSE="BSD"
SLOT="0"
KEYWORDS=""
IUSE="gcrypt mbedtls zlib"
IUSE="gcrypt mbedtls test zlib"
REQUIRED_USE="?? ( gcrypt mbedtls )"
RESTRICT="test"
RESTRICT="!test? ( test )"
RDEPEND="
gcrypt? ( >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] )
@ -26,12 +26,10 @@ RDEPEND="
)
zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
"
DEPEND="
${RDEPEND}
"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${PN}-1.8.0-mansyntax_sh.patch
"${FILESDIR}"/${PN}-1.11.0-mansyntax_sh.patch
)
multilib_src_configure() {
@ -44,13 +42,24 @@ multilib_src_configure() {
local mycmakeargs=(
-DBUILD_SHARED_LIBS=ON
-DBUILD_TESTING=$(usex test)
-DCRYPTO_BACKEND=${crypto_backend}
-DENABLE_ZLIB_COMPRESSION=$(usex zlib)
-DRUN_SSHD_TESTS=OFF
-DRUN_DOCKER_TESTS=OFF
)
if use test ; then
# Pass separately to avoid unused var warnings w/ USE=-test
mycmakeargs+=(
-DRUN_SSHD_TESTS=OFF
-DRUN_DOCKER_TESTS=OFF
)
fi
cmake_src_configure
}
multilib_src_install_all() {
einstalldocs
find "${ED}" -name '*.la' -delete || die
}

View File

@ -1,15 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>netmon@gentoo.org</email>
</maintainer>
<maintainer type="person">
<email>mgorny@gentoo.org</email>
<name>Michał Górny</name>
</maintainer>
<use>
<flag name="gcrypt">Use <pkg>dev-libs/libgcrypt</pkg> instead of <pkg>dev-libs/openssl</pkg></flag>
<flag name="mbedtls">Use <pkg>net-libs/mbedtls</pkg> instead of <pkg>dev-libs/openssl</pkg></flag>
</use>
<maintainer type="project">
<email>netmon@gentoo.org</email>
</maintainer>
<maintainer type="person">
<email>mgorny@gentoo.org</email>
<name>Michał Górny</name>
</maintainer>
<use>
<flag name="gcrypt">Use <pkg>dev-libs/libgcrypt</pkg> instead of <pkg>dev-libs/openssl</pkg></flag>
<flag name="mbedtls">Use <pkg>net-libs/mbedtls</pkg> instead of <pkg>dev-libs/openssl</pkg></flag>
</use>
<upstream>
<remote-id type="github">libssh2/libssh2</remote-id>
</upstream>
</pkgmetadata>