dev-libs/libnl: Sync with Gentoo

It's from Gentoo commit bb1d0f576638f4fb1dca5ab0cc955418834fcd9d.

Signed-off-by: Flatcar Buildbot <buildbot@flatcar-linux.org>
This commit is contained in:
Flatcar Buildbot 2026-02-02 07:25:44 +00:00
parent 1ec3157f57
commit bf2019745a
6 changed files with 380 additions and 14 deletions

View File

@ -1,2 +1,5 @@
DIST libnl-3.10.0.tar.gz 1116186 BLAKE2B 13383c4ef49be3bcf89122b24d1d5dc9834353aa7128f04f50993203add14aa7f97a4500164982ddcb82f481f7324a26efc2375036d5a23bfa62b15c4fe07473 SHA512 c95e79fba69308c63a08d0c576503b4398710ea9cd1d0097851500a7fbc5fbe87fb32ac281cf42bbfe57eab07b110055e6bc9b95d82244bba3df8a31fe562962
DIST libnl-3.11.0.tar.gz 1124072 BLAKE2B 8e2792620f56e1e9e05e4fe1f9bece70938c82c2d1a9f4e0f9de1ce0b1a7a2bf60f31a42e6056407b383875c08c575b26df87b9bd6b421d5053e96983e193c54 SHA512 69ecec6e792fc7b9c443fff8742cf45782af5c5c4664687440942eaeb616ba7b4ed2b606e33c5d86e44e6b49a9c79a1fed4b7c77781a059e13cf6a844d94530e
DIST libnl-3.11.0.tar.gz.sig 862 BLAKE2B 48386ba3821e4876d425a929a562b5c85a8da3db26effa81c8e2494458b9cb840425bd795924b79a068ddf2ccb6ca56e5874cd91b64b10f9a3948e069d42a810 SHA512 de98fdd254ec587c1e467b590b6f876c8dee0ef10be86b0644c6de366f4deba9205ffa1881d6a6c394af9543dea38eb4553139ad9293c5788ef23c15db4381df
DIST libnl-3.12.0.tar.gz 1191546 BLAKE2B 103bec122b3d021cbed5096a50fda2a480e03cf31a4ed4bb996bb7b9d3be77489ba9a0a9c4129bbba570cdb9775cd98f0b93c8b16464802073485501a1134e6e SHA512 6230b8cab608355346030cf32f37c43983b1d1b632cb7677ae383d4f2369b4a3773b35d2d51007d3b9c16f333aaf351682c4602b3d229cd602eec5ad53efd6f3
DIST libnl-3.12.0.tar.gz.sig 512 BLAKE2B e0f34aa7738187b48b340a399b3edaa818fec355898315a6a45db22ce413ae456de771f33971e3fd3cb2b8d826d545ba7d70f8fc893b41fc126af8830590df02 SHA512 b6241ec76fd43884e1e9122e215b0b1a21a5b003fce6532775bb4393f6b7e462d154f95104dee9387d68583a9c9e202e953a2c1d31b34b508cd84ef37c79bf22

View File

@ -0,0 +1,201 @@
https://github.com/thom311/libnl/issues/448
https://github.com/thom311/libnl/commit/f680f27d61be1de3f4a0e50c7158c1cd0d6df585
https://github.com/thom311/libnl/commit/1ac4b3216501574e7621618477d91b8fab13164a
From f680f27d61be1de3f4a0e50c7158c1cd0d6df585 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thom311@gmail.com>
Date: Tue, 23 Dec 2025 21:31:06 +0100
Subject: [PATCH] tests: add and use _nltst_skip_eopnotsupp() helper
---
tests/cksuite-all-netns.c | 3 +--
tests/cksuite-route-nh.c | 4 +---
tests/nl-test-util.c | 11 +++++++++++
tests/nl-test-util.h | 4 ++++
4 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/tests/cksuite-all-netns.c b/tests/cksuite-all-netns.c
index ff6fd6576..4714db268 100644
--- a/tests/cksuite-all-netns.c
+++ b/tests/cksuite-all-netns.c
@@ -273,8 +273,7 @@ START_TEST(test_create_iface)
}
r = rtnl_link_add(sk, link, NLM_F_CREATE);
- if (r == -NLE_OPNOTSUPP) {
- /* Hm, no kernel module? Skip the test. */
+ if (_nltst_skip_eopnotsupp(r)) {
_nltst_assert_link_not_exists(IFNAME);
IFNAME = NULL;
return;
diff --git a/tests/cksuite-route-nh.c b/tests/cksuite-route-nh.c
index d31cecf3c..e05c94df1 100644
--- a/tests/cksuite-route-nh.c
+++ b/tests/cksuite-route-nh.c
@@ -1054,10 +1054,8 @@ START_TEST(test_kernel_roundtrip_encap_ila)
ck_assert_int_eq(rtnl_nh_set_oif(nh, (uint32_t)ifindex_dummy), 0);
ck_assert_int_eq(rtnl_nh_set_family(nh, AF_INET6), 0);
ret = rtnl_nh_add(sk, nh, NLM_F_CREATE);
- if (ret == -NLE_OPNOTSUPP) {
- /* ila module is not loaded - skipping */
+ if (_nltst_skip_eopnotsupp(ret))
return;
- }
ck_assert_int_eq(ret, 0);
ck_assert_int_eq(rtnl_nh_alloc_cache(sk, AF_UNSPEC, &cache), 0);
diff --git a/tests/nl-test-util.c b/tests/nl-test-util.c
index 51c04c69f..75bb54035 100644
--- a/tests/nl-test-util.c
+++ b/tests/nl-test-util.c
@@ -838,6 +838,17 @@ bool _nltst_skip_no_iproute2(const char *msg)
/*****************************************************************************/
+bool _nltst_skip_eopnotsupp(int err)
+{
+ if (err != -NLE_OPNOTSUPP)
+ return false;
+
+ printf("skip test after operation failed with NLE_OPNOTSUPP. This indicates missing kernel support");
+ return true;
+}
+
+/*****************************************************************************/
+
void _nltst_add_dummy_and_up(struct nl_sock *sk, const char *ifname,
int *out_ifindex)
{
diff --git a/tests/nl-test-util.h b/tests/nl-test-util.h
index ecae8856a..a2c0e3b3f 100644
--- a/tests/nl-test-util.h
+++ b/tests/nl-test-util.h
@@ -449,6 +449,10 @@ bool _nltst_skip_no_iproute2(const char *msg);
/*****************************************************************************/
+bool _nltst_skip_eopnotsupp(int err);
+
+/*****************************************************************************/
+
typedef struct {
int addr_family;
int ifindex;
From 1ac4b3216501574e7621618477d91b8fab13164a Mon Sep 17 00:00:00 2001
From: Thomas Haller <thom311@gmail.com>
Date: Tue, 23 Dec 2025 21:35:06 +0100
Subject: [PATCH] tests: skip various tests when kernel returns EOPNOTSUPP
(NLE_OPNOTSUPP)
https://github.com/thom311/libnl/issues/448
---
tests/cksuite-link-ip6tnl.c | 2 ++
tests/cksuite-route-nexthop.c | 6 +++++-
tests/cksuite-route-nh.c | 21 ++++++++++++++++++---
3 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/tests/cksuite-link-ip6tnl.c b/tests/cksuite-link-ip6tnl.c
index ea785b864..c5dc35341 100644
--- a/tests/cksuite-link-ip6tnl.c
+++ b/tests/cksuite-link-ip6tnl.c
@@ -97,6 +97,8 @@ START_TEST(test_kernel_roundtrip_all)
* This tests the netlink-message construction.
*/
r = rtnl_link_add(sk, link, NLM_F_CREATE);
+ if (_nltst_skip_eopnotsupp(r))
+ return;
ck_assert_int_eq(r, 0);
/* Now, query it and check whether all the attributes passed.
diff --git a/tests/cksuite-route-nexthop.c b/tests/cksuite-route-nexthop.c
index 34fc1d3b3..971a580bd 100644
--- a/tests/cksuite-route-nexthop.c
+++ b/tests/cksuite-route-nexthop.c
@@ -416,6 +416,7 @@ START_TEST(test_kernel_route_roundtrip_nh_mpls_encap_v4)
struct rtnl_nh_encap *encap2;
struct rtnl_nexthop *nh = NULL;
int ifindex_dummy;
+ int r;
if (_nltst_skip_no_netns())
return;
@@ -447,7 +448,10 @@ START_TEST(test_kernel_route_roundtrip_nh_mpls_encap_v4)
ck_assert_int_eq(rtnl_route_nh_set_encap(nh, encap2), 0);
rtnl_route_add_nexthop(route, nh);
- ck_assert_int_eq(rtnl_route_add(sk, route, NLM_F_CREATE), 0);
+ r = rtnl_route_add(sk, route, NLM_F_CREATE);
+ if (_nltst_skip_eopnotsupp(r))
+ return;
+ ck_assert_int_eq(r, 0);
/* Retrieve the route back by its prefix and validate MPLS encap on nexthop */
ck_assert_int_eq(nltst_route_get_by_dst(sk, dst, &got), 0);
diff --git a/tests/cksuite-route-nh.c b/tests/cksuite-route-nh.c
index e05c94df1..b6ab8dc1e 100644
--- a/tests/cksuite-route-nh.c
+++ b/tests/cksuite-route-nh.c
@@ -91,6 +91,7 @@ START_TEST(test_kernel_roundtrip_encap_mpls)
_nl_auto_nl_addr struct nl_addr *labels = NULL;
struct rtnl_nh_encap *encap = NULL;
int ifindex_dummy;
+ int r;
if (_nltst_skip_no_netns())
return;
@@ -127,7 +128,11 @@ START_TEST(test_kernel_roundtrip_encap_mpls)
ck_assert_int_eq(rtnl_nh_add(sk, nh, NLM_F_CREATE), -NLE_INVAL);
ck_assert_int_eq(rtnl_nh_set_family(nh, AF_INET), 0);
- ck_assert_int_eq(rtnl_nh_add(sk, nh, NLM_F_CREATE), 0);
+
+ r = rtnl_nh_add(sk, nh, NLM_F_CREATE);
+ if (_nltst_skip_eopnotsupp(r))
+ return;
+ ck_assert_int_eq(r, 0);
/* Query and verify */
ck_assert_int_eq(rtnl_nh_alloc_cache(sk, AF_UNSPEC, &cache), 0);
@@ -944,6 +949,7 @@ START_TEST(test_kernel_roundtrip_encap_ip6)
_nl_auto_rtnl_nh_encap struct rtnl_nh_encap *encap = NULL;
uint16_t flags;
int ifindex_dummy;
+ int r;
if (_nltst_skip_no_netns())
return;
@@ -980,7 +986,11 @@ START_TEST(test_kernel_roundtrip_encap_ip6)
/* Set required attributes and add */
ck_assert_int_eq(rtnl_nh_set_oif(nh, (uint32_t)ifindex_dummy), 0);
ck_assert_int_eq(rtnl_nh_set_family(nh, AF_INET6), 0);
- ck_assert_int_eq(rtnl_nh_add(sk, nh, NLM_F_CREATE), 0);
+
+ r = rtnl_nh_add(sk, nh, NLM_F_CREATE);
+ if (_nltst_skip_eopnotsupp(r))
+ return;
+ ck_assert_int_eq(r, 0);
/* Query and verify */
ck_assert_int_eq(rtnl_nh_alloc_cache(sk, AF_UNSPEC, &cache), 0);
@@ -1097,6 +1107,7 @@ START_TEST(test_kernel_roundtrip_encap_ip)
_nl_auto_rtnl_nh_encap struct rtnl_nh_encap *encap = NULL;
int ifindex_dummy;
uint64_t id = 0;
+ int r;
if (_nltst_skip_no_netns())
return;
@@ -1132,7 +1143,11 @@ START_TEST(test_kernel_roundtrip_encap_ip)
/* Set required attributes and add */
ck_assert_int_eq(rtnl_nh_set_oif(nh, (uint32_t)ifindex_dummy), 0);
ck_assert_int_eq(rtnl_nh_set_family(nh, AF_INET), 0);
- ck_assert_int_eq(rtnl_nh_add(sk, nh, NLM_F_CREATE), 0);
+
+ r = rtnl_nh_add(sk, nh, NLM_F_CREATE);
+ if (_nltst_skip_eopnotsupp(r))
+ return;
+ ck_assert_int_eq(r, 0);
/* Query and verify */
ck_assert_int_eq(rtnl_nh_alloc_cache(sk, AF_UNSPEC, &cache), 0);

View File

@ -22,7 +22,7 @@ if [[ ${PV} == 9999 ]] ; then
inherit git-r3
else
SRC_URI="https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
S="${WORKDIR}/${LIBNL_P}"
fi

View File

@ -1,4 +1,4 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -9,6 +9,7 @@ DISTUTILS_EXT=1
DISTUTILS_OPTIONAL=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..14} )
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/thomashaller.asc
inherit autotools distutils-r1 multilib-minimal
LIBNL_P=${P/_/-}
@ -17,24 +18,32 @@ LIBNL_DIR=${LIBNL_DIR//./_}
DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel interfaces"
HOMEPAGE="https://www.infradead.org/~tgr/libnl/ https://github.com/thom311/libnl"
if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="https://github.com/thom311/libnl"
inherit git-r3
else
SRC_URI="https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
inherit verify-sig
SRC_URI="
https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz
verify-sig? ( https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz.sig )
"
S="${WORKDIR}/${LIBNL_P}"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-thomashaller )"
fi
LICENSE="LGPL-2.1 utils? ( GPL-2 )"
SLOT="3"
IUSE="+debug python test utils"
RESTRICT="!test? ( test )"
# bug #968602
RESTRICT="!test? ( test ) test"
RDEPEND="python? ( ${PYTHON_DEPS} )"
DEPEND="${RDEPEND}"
BDEPEND="
BDEPEND+="
${RDEPEND}
sys-devel/bison
sys-devel/flex

View File

@ -0,0 +1,145 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
# Make sure to test USE=utils on bumps and update MULTILIB_WRAPPED_HEADERS if needed
DISTUTILS_EXT=1
DISTUTILS_OPTIONAL=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..14} )
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/thomashaller.asc
inherit autotools distutils-r1 multilib-minimal
LIBNL_P=${P/_/-}
LIBNL_DIR=${PV/_/}
LIBNL_DIR=${LIBNL_DIR//./_}
DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel interfaces"
HOMEPAGE="https://www.infradead.org/~tgr/libnl/ https://github.com/thom311/libnl"
if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="https://github.com/thom311/libnl"
inherit git-r3
else
inherit verify-sig
SRC_URI="
https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz
verify-sig? ( https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz.sig )
"
S="${WORKDIR}/${LIBNL_P}"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-thomashaller )"
fi
LICENSE="LGPL-2.1 utils? ( GPL-2 )"
SLOT="3"
IUSE="+debug python test utils"
# test_kernel_route_roundtrip_* fais in 3.12.0
RESTRICT="!test? ( test ) test"
RDEPEND="python? ( ${PYTHON_DEPS} )"
DEPEND="${RDEPEND}"
BDEPEND+="
${RDEPEND}
sys-devel/bison
sys-devel/flex
virtual/pkgconfig
python? (
${DISTUTILS_DEPS}
dev-lang/swig
)
test? ( dev-libs/check )
"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
MULTILIB_WRAPPED_HEADERS=(
# We do not install CLI stuff for non-native
/usr/include/libnl3/netlink/cli/addr.h
/usr/include/libnl3/netlink/cli/class.h
/usr/include/libnl3/netlink/cli/cls.h
/usr/include/libnl3/netlink/cli/ct.h
/usr/include/libnl3/netlink/cli/exp.h
/usr/include/libnl3/netlink/cli/link.h
/usr/include/libnl3/netlink/cli/mdb.h
/usr/include/libnl3/netlink/cli/nh.h
/usr/include/libnl3/netlink/cli/neigh.h
/usr/include/libnl3/netlink/cli/qdisc.h
/usr/include/libnl3/netlink/cli/route.h
/usr/include/libnl3/netlink/cli/rule.h
/usr/include/libnl3/netlink/cli/tc.h
/usr/include/libnl3/netlink/cli/utils.h
)
PATCHES=(
"${FILESDIR}"/${PN}-3.11.0-no-iproute2.patch
"${FILESDIR}"/${P}-tests.patch
)
src_prepare() {
default
eautoreconf
if use python; then
pushd "${S}"/python > /dev/null || die
distutils-r1_src_prepare
popd > /dev/null || die
fi
}
multilib_src_configure() {
# bug #884277
export YACC=yacc.bison
ECONF_SOURCE="${S}" econf \
$(multilib_native_use_enable utils cli) \
$(use_enable debug)
}
multilib_src_compile() {
default
if multilib_is_native_abi && use python ; then
pushd python > /dev/null || die
distutils-r1_src_compile
popd > /dev/null || die
fi
}
multilib_src_test() {
CK_VERBOSITY=verbose emake check VERBOSE=1
if multilib_is_native_abi && use python ; then
pushd python > /dev/null || die
# TODO: run python/tests/test-create-bridge.py
distutils-r1_src_test
popd > /dev/null || die
fi
}
multilib_src_install() {
default
if multilib_is_native_abi && use python ; then
# Unset DOCS= since distutils-r1.eclass interferes
local DOCS=()
pushd python > /dev/null || die
distutils-r1_src_install
popd > /dev/null || die
fi
}
multilib_src_install_all() {
DOCS=( ChangeLog )
einstalldocs
find "${ED}" -name '*.la' -delete || die
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -9,6 +9,7 @@ DISTUTILS_EXT=1
DISTUTILS_OPTIONAL=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..14} )
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/thomashaller.asc
inherit autotools distutils-r1 multilib-minimal
LIBNL_P=${P/_/-}
@ -17,24 +18,32 @@ LIBNL_DIR=${LIBNL_DIR//./_}
DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel interfaces"
HOMEPAGE="https://www.infradead.org/~tgr/libnl/ https://github.com/thom311/libnl"
if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="https://github.com/thom311/libnl"
inherit git-r3
else
SRC_URI="https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
inherit verify-sig
SRC_URI="
https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz
verify-sig? ( https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz.sig )
"
S="${WORKDIR}/${LIBNL_P}"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-thomashaller )"
fi
LICENSE="LGPL-2.1 utils? ( GPL-2 )"
SLOT="3"
IUSE="+debug python test utils"
RESTRICT="!test? ( test )"
# test_kernel_route_roundtrip_* fais in 3.12.0
RESTRICT="!test? ( test ) test"
RDEPEND="python? ( ${PYTHON_DEPS} )"
DEPEND="${RDEPEND}"
BDEPEND="
BDEPEND+="
${RDEPEND}
sys-devel/bison
sys-devel/flex
@ -66,7 +75,6 @@ MULTILIB_WRAPPED_HEADERS=(
)
PATCHES=(
"${FILESDIR}"/0001-Fix-compilation-error-in-GCC-14.patch
"${FILESDIR}"/${PN}-3.11.0-no-iproute2.patch
)