From 2ae1330a22e62ddc9ac3e25daf974a2e01da11d3 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Sat, 25 May 2024 15:30:25 +0000 Subject: [PATCH] iproute2: update to 6.9.0 Support for iptables action has been dropped. Remove tc-mod-iptables and related patch (175-reduce-dynamic-syms.patch). We also add the missing libbpf dependency for `ss` since iproute 8740ca9 ("ss: add support for BPF socket-local storage") now means that `ss` requires libbpf as well. Fix 170-ip_tiny.patch, as the help text didn't match all the included functions. Drop upstreamed patches 402-bpf-fix-warning-from-basename.patch and 403-bpf-include-libgen.h-for-basename.patch. All other patches automatically rebased. Co-authored-by: Rany Hany Signed-off-by: Rui Salvaterra Signed-off-by: Rany Hany --- package/network/utils/iproute2/Makefile | 23 ++-------- .../patches/115-add-config-xtlibdir.patch | 2 +- .../130-no_netem_tipc_dcb_man_vdpa.patch | 2 +- .../patches/140-keep_libmnl_optional.patch | 2 +- .../patches/145-keep_libelf_optional.patch | 2 +- .../patches/150-keep_libcap_optional.patch | 2 +- .../patches/155-keep_tirpc_optional.patch | 2 +- .../utils/iproute2/patches/170-ip_tiny.patch | 10 ++--- .../patches/175-reduce-dynamic-syms.patch | 45 ------------------- .../patches/190-fix-nls-rpath-link.patch | 4 +- .../patches/195-build_variant_ip_tc.patch | 4 +- .../patches/200-drop_libbsd_dependency.patch | 2 +- .../patches/300-selinux-configurable.patch | 2 +- .../402-bpf-fix-warning-from-basename.patch | 38 ---------------- ...03-bpf-include-libgen.h-for-basename.patch | 23 ---------- 15 files changed, 21 insertions(+), 142 deletions(-) delete mode 100644 package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch delete mode 100644 package/network/utils/iproute2/patches/402-bpf-fix-warning-from-basename.patch delete mode 100644 package/network/utils/iproute2/patches/403-bpf-include-libgen.h-for-basename.patch diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 2f9d2f2bc9..85d9f437f6 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 -PKG_VERSION:=6.7.0 +PKG_VERSION:=6.9.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 -PKG_HASH:=ff942dd9828d7d1f867f61fe72ce433078c31e5d8e4a78e20f02cb5892e8841d +PKG_HASH:=2f643d09ea11a4a2a043c92e2b469b5f73228cbf241ae806760296ed0ec413d0 PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=iptables PKG_LICENSE:=GPL-2.0 @@ -77,14 +77,7 @@ $(call Package/iproute2/Default) VARIANT:=tcfull PROVIDES:=tc ALTERNATIVES:=400:/sbin/tc:/usr/libexec/tc-full - DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libbpf +libxtables +tc-mod-iptables -endef - -define Package/tc-mod-iptables -$(call Package/iproute2/Default) - TITLE:=Traffic control module - iptables action - VARIANT:=tcfull - DEPENDS:=+libxtables +libbpf + DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libbpf +libxtables endef define Package/genl @@ -102,7 +95,7 @@ endef define Package/ss $(call Package/iproute2/Default) TITLE:=Socket statistics utility - DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +kmod-netlink-diag + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libbpf +kmod-netlink-diag endef define Package/nstat @@ -232,11 +225,6 @@ define Package/tc-full/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/libexec/tc-full endef -define Package/tc-mod-iptables/install - $(INSTALL_DIR) $(1)/usr/lib/tc - $(CP) $(PKG_BUILD_DIR)/tc/m_xt.so $(1)/usr/lib/tc -endef - define Package/genl/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/ @@ -269,9 +257,6 @@ endef $(eval $(call BuildPackage,ip-tiny)) $(eval $(call BuildPackage,ip-full)) -# build tc-mod-iptables before its dependents, to avoid -# spurious rebuilds when building multiple variants. -$(eval $(call BuildPackage,tc-mod-iptables)) $(eval $(call BuildPackage,tc-tiny)) $(eval $(call BuildPackage,tc-bpf)) $(eval $(call BuildPackage,tc-full)) diff --git a/package/network/utils/iproute2/patches/115-add-config-xtlibdir.patch b/package/network/utils/iproute2/patches/115-add-config-xtlibdir.patch index c32863c364..38448e6cd6 100644 --- a/package/network/utils/iproute2/patches/115-add-config-xtlibdir.patch +++ b/package/network/utils/iproute2/patches/115-add-config-xtlibdir.patch @@ -1,6 +1,6 @@ --- a/tc/Makefile +++ b/tc/Makefile -@@ -119,6 +119,9 @@ CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PR +@@ -107,6 +107,9 @@ CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PR ifneq ($(IPT_LIB_DIR),) CFLAGS += -DIPT_LIB_DIR=\"$(IPT_LIB_DIR)\" endif diff --git a/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch b/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch index 8c70c14489..7f946070f9 100644 --- a/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch +++ b/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -68,9 +68,9 @@ WFLAGS += -Wmissing-declarations -Wold-s +@@ -69,9 +69,9 @@ WFLAGS += -Wmissing-declarations -Wold-s CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS) YACCFLAGS = -d -t -v diff --git a/package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch b/package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch index 0d22875751..ee18f17d54 100644 --- a/package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch +++ b/package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -391,7 +391,7 @@ check_tirpc() +@@ -362,7 +362,7 @@ check_tirpc() check_mnl() { diff --git a/package/network/utils/iproute2/patches/145-keep_libelf_optional.patch b/package/network/utils/iproute2/patches/145-keep_libelf_optional.patch index bffacddb21..99b9d326fe 100644 --- a/package/network/utils/iproute2/patches/145-keep_libelf_optional.patch +++ b/package/network/utils/iproute2/patches/145-keep_libelf_optional.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -246,7 +246,7 @@ EOF +@@ -217,7 +217,7 @@ EOF check_elf() { diff --git a/package/network/utils/iproute2/patches/150-keep_libcap_optional.patch b/package/network/utils/iproute2/patches/150-keep_libcap_optional.patch index 570e9c7038..767c968e74 100644 --- a/package/network/utils/iproute2/patches/150-keep_libcap_optional.patch +++ b/package/network/utils/iproute2/patches/150-keep_libcap_optional.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -449,7 +449,7 @@ EOF +@@ -421,7 +421,7 @@ EOF check_cap() { diff --git a/package/network/utils/iproute2/patches/155-keep_tirpc_optional.patch b/package/network/utils/iproute2/patches/155-keep_tirpc_optional.patch index 4d7fb76308..011dd48f8e 100644 --- a/package/network/utils/iproute2/patches/155-keep_tirpc_optional.patch +++ b/package/network/utils/iproute2/patches/155-keep_tirpc_optional.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -378,7 +378,7 @@ check_selinux() +@@ -349,7 +349,7 @@ check_selinux() check_tirpc() { diff --git a/package/network/utils/iproute2/patches/170-ip_tiny.patch b/package/network/utils/iproute2/patches/170-ip_tiny.patch index 71081c36bc..149bcd2afc 100644 --- a/package/network/utils/iproute2/patches/170-ip_tiny.patch +++ b/package/network/utils/iproute2/patches/170-ip_tiny.patch @@ -30,15 +30,15 @@ "Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n" " ip [ -force ] -batch filename\n" +#ifndef IPROUTE2_TINY - "where OBJECT := { address | addrlabel | amt | fou | help | ila | ioam | l2tp |\n" - " link | macsec | maddress | monitor | mptcp | mroute | mrule |\n" + "where OBJECT := { address | addrlabel | fou | help | ila | ioam | l2tp | link |\n" + " macsec | maddress | monitor | mptcp | mroute | mrule |\n" " neighbor | neighbour | netconf | netns | nexthop | ntable |\n" - " ntbl | route | rule | sr | tap | tcpmetrics |\n" + " ntbl | route | rule | sr | stats | tap | tcpmetrics |\n" " token | tunnel | tuntap | vrf | xfrm }\n" +#else -+ "where OBJECT := { address | link | maddress | monitor |\n" ++ "where OBJECT := { address | help | link | maddress | monitor |\n" + " neighbor | neighbour | netns | route |\n" -+ " rule | token | tunnel }\n" ++ " rule | stats | token | tunnel }\n" +#endif " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n" " -h[uman-readable] | -iec | -j[son] | -p[retty] |\n" diff --git a/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch b/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch deleted file mode 100644 index aef51395a9..0000000000 --- a/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- a/tc/Makefile -+++ b/tc/Makefile -@@ -106,7 +106,7 @@ LDLIBS += -L. -lm - - ifeq ($(SHARED_LIBS),y) - LDLIBS += -ldl --LDFLAGS += -Wl,-export-dynamic -+LDFLAGS += -Wl,--dynamic-list=dynsyms.list - endif - - TCLIB := tc_core.o -@@ -135,7 +135,7 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc - all: tc $(TCSO) - - tc: $(TCOBJ) $(LIBNETLINK) libtc.a -- $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@ -+ $(QUIET_LINK)$(CC) $(filter-out dynsyms.list, $^) $(LDFLAGS) $(LDLIBS) -o $@ - - libtc.a: $(TCLIB) - $(QUIET_AR)$(AR) rcs $@ $^ -@@ -157,6 +157,7 @@ install: all - clean: - rm -f $(TCOBJ) $(TCLIB) libtc.a tc *.so emp_ematch.tab.h; \ - rm -f emp_ematch.tab.* -+ rm -f dynsyms.list - - m_xt.so: m_xt.c - $(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fpic -o m_xt.so m_xt.c $$($(PKG_CONFIG) xtables --cflags --libs) -@@ -193,4 +194,16 @@ static-syms.h: $(wildcard *.c) - sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \ - done > $@ - -+else -+ -+tc: dynsyms.list -+m_xt.so: dynsyms.list -+dynsyms.list: $(wildcard *.c) -+ files="$(filter-out $(patsubst %.so,%.c,$(TCSO)), $^)" ; \ -+ echo "{" > $@ ; \ -+ for s in `grep -B 3 '\> $@ ; \ -+ echo "show_stats; print_nl; print_tm; parse_rtattr; parse_rtattr_flags; get_u32; matches; addattr_l; addattr_nest; addattr_nest_end; };" >> $@ -+ - endif diff --git a/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch b/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch index 765e4ad2e8..545075fd85 100644 --- a/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch +++ b/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -270,7 +270,7 @@ int main(int argc, char **argv) { +@@ -241,7 +241,7 @@ int main(int argc, char **argv) { } EOF @@ -9,7 +9,7 @@ local ret=$? rm -f $TMPDIR/libbpf_test.c $TMPDIR/libbpf_test -@@ -288,7 +288,7 @@ int main(int argc, char **argv) { +@@ -259,7 +259,7 @@ int main(int argc, char **argv) { } EOF diff --git a/package/network/utils/iproute2/patches/195-build_variant_ip_tc.patch b/package/network/utils/iproute2/patches/195-build_variant_ip_tc.patch index 8156adbf05..6ecf5568be 100644 --- a/package/network/utils/iproute2/patches/195-build_variant_ip_tc.patch +++ b/package/network/utils/iproute2/patches/195-build_variant_ip_tc.patch @@ -11,7 +11,7 @@ --- a/tc/Makefile +++ b/tc/Makefile -@@ -132,7 +132,7 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc +@@ -120,7 +120,7 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc $(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fpic $< -o $@ @@ -19,4 +19,4 @@ +all: $(findstring tc,$(BUILD_VARIANT)) $(TCSO) tc: $(TCOBJ) $(LIBNETLINK) libtc.a - $(QUIET_LINK)$(CC) $(filter-out dynsyms.list, $^) $(LDFLAGS) $(LDLIBS) -o $@ + $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@ diff --git a/package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch b/package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch index 92bf5cb66d..e41be20f10 100644 --- a/package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch +++ b/package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -435,14 +435,8 @@ EOF +@@ -407,14 +407,8 @@ EOF if $CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1; then echo "no" else diff --git a/package/network/utils/iproute2/patches/300-selinux-configurable.patch b/package/network/utils/iproute2/patches/300-selinux-configurable.patch index a611ba75f0..36ecc735a7 100644 --- a/package/network/utils/iproute2/patches/300-selinux-configurable.patch +++ b/package/network/utils/iproute2/patches/300-selinux-configurable.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -365,7 +365,7 @@ check_libbpf() +@@ -336,7 +336,7 @@ check_libbpf() check_selinux() # SELinux is a compile time option in the ss utility { diff --git a/package/network/utils/iproute2/patches/402-bpf-fix-warning-from-basename.patch b/package/network/utils/iproute2/patches/402-bpf-fix-warning-from-basename.patch deleted file mode 100644 index 8b40ffecf6..0000000000 --- a/package/network/utils/iproute2/patches/402-bpf-fix-warning-from-basename.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 69e3b2fadcd32683db2942f31fe41f0fbb2185f8 Mon Sep 17 00:00:00 2001 -From: Stephen Hemminger -Date: Sat, 27 Jan 2024 13:58:14 -0800 -Subject: [PATCH] bpf: fix warning from basename() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The function basename() expects a mutable character string, -which now causes a warning: - -bpf_legacy.c: In function ‘bpf_load_common’: -bpf_legacy.c:975:38: warning: passing argument 1 of ‘__xpg_basename’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] - 975 | basename(cfg->object), cfg->mode == EBPF_PINNED ? - | ~~~^~~~~~~~ -In file included from bpf_legacy.c:21: -/usr/include/libgen.h:34:36: note: expected ‘char *’ but argument is of type ‘const char *’ - 34 | extern char *__xpg_basename (char *__path) __THROW; - -Fixes: f20ff2f19552 ("bpf: keep parsed program mode in struct bpf_cfg_in") -Signed-off-by: Stephen Hemminger ---- - lib/bpf_legacy.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/lib/bpf_legacy.c -+++ b/lib/bpf_legacy.c -@@ -971,8 +971,8 @@ int bpf_load_common(struct bpf_cfg_in *c - ops->cbpf_cb(nl, cfg->opcodes, cfg->n_opcodes); - if (cfg->mode == EBPF_OBJECT || cfg->mode == EBPF_PINNED) { - snprintf(annotation, sizeof(annotation), "%s:[%s]", -- basename(cfg->object), cfg->mode == EBPF_PINNED ? -- "*fsobj" : cfg->section); -+ basename(strdupa(cfg->object)), -+ cfg->mode == EBPF_PINNED ? "*fsobj" : cfg->section); - ops->ebpf_cb(nl, cfg->prog_fd, annotation); - } - diff --git a/package/network/utils/iproute2/patches/403-bpf-include-libgen.h-for-basename.patch b/package/network/utils/iproute2/patches/403-bpf-include-libgen.h-for-basename.patch deleted file mode 100644 index c65d94bd75..0000000000 --- a/package/network/utils/iproute2/patches/403-bpf-include-libgen.h-for-basename.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 64ed1886e719f40acb554ac895305acb43f27bea Mon Sep 17 00:00:00 2001 -From: Pedro Tammela -Date: Mon, 22 Jan 2024 18:05:46 -0300 -Subject: [PATCH] bpf: include libgen.h for basename - -In musl basename() is only available via libgen.h - -Signed-off-by: Pedro Tammela -Signed-off-by: Stephen Hemminger ---- - lib/bpf_legacy.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/lib/bpf_legacy.c -+++ b/lib/bpf_legacy.c -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - - #ifdef HAVE_ELF - #include -- 2.30.2