iproute2: update to 6.9.0
authorRui Salvaterra <rsalvaterra@gmail.com>
Sat, 25 May 2024 15:30:25 +0000 (15:30 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 31 May 2024 09:13:31 +0000 (11:13 +0200)
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 <rany_hany@riseup.net>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Rany Hany <rany_hany@riseup.net>
15 files changed:
package/network/utils/iproute2/Makefile
package/network/utils/iproute2/patches/115-add-config-xtlibdir.patch
package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch
package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch
package/network/utils/iproute2/patches/145-keep_libelf_optional.patch
package/network/utils/iproute2/patches/150-keep_libcap_optional.patch
package/network/utils/iproute2/patches/155-keep_tirpc_optional.patch
package/network/utils/iproute2/patches/170-ip_tiny.patch
package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch [deleted file]
package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch
package/network/utils/iproute2/patches/195-build_variant_ip_tc.patch
package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch
package/network/utils/iproute2/patches/300-selinux-configurable.patch
package/network/utils/iproute2/patches/402-bpf-fix-warning-from-basename.patch [deleted file]
package/network/utils/iproute2/patches/403-bpf-include-libgen.h-for-basename.patch [deleted file]

index 2f9d2f2bc98110f9ec831bdf15656f626f2b66b3..85d9f437f63e6b7a570deb2b5a52c2bd7dcfba06 100644 (file)
@@ -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))
index c32863c3648997926ef915ac458e6f1cc75abcd6..38448e6cd6f920041bc0d264b31ea668238d4bc2 100644 (file)
@@ -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
index 8c70c14489199d50b54ba0cf6f059e350f7f9463..7f946070f9091de6db37cd2e99ad91df18cc58d4 100644 (file)
@@ -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
  
index 0d228757517fa7fbfc3af7ccbf7904a220e28201..ee18f17d54f00e8f18d891ff0aabbc970f6052e5 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -391,7 +391,7 @@ check_tirpc()
+@@ -362,7 +362,7 @@ check_tirpc()
  
  check_mnl()
  {
index bffacddb21738d67ac285ae0874f593478473e60..99b9d326fe4f8bdf5535929c9fbe6e5a9590b9ae 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -246,7 +246,7 @@ EOF
+@@ -217,7 +217,7 @@ EOF
  
  check_elf()
  {
index 570e9c7038bc27000cf88f98e4da1a725d4079ed..767c968e74c289455f4b3b6abb5e33007686a4e6 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -449,7 +449,7 @@ EOF
+@@ -421,7 +421,7 @@ EOF
  
  check_cap()
  {
index 4d7fb76308683e04097949603ffb7167ff6785e1..011dd48f8e14f355bb640a2de319d66de86e84e7 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -378,7 +378,7 @@ check_selinux()
+@@ -349,7 +349,7 @@ check_selinux()
  
  check_tirpc()
  {
index 71081c36bccb98d2895fc70b68248b004c33152f..149bcd2afcbb6cba0e4ce0c2616a6a4cda2eccce 100644 (file)
                "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 (file)
index aef5139..0000000
+++ /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 '\<dlsym' $$files | sed -n '/snprintf/{s:.*"\([^"]*\)".*:\1:;s:%s::;p}'` ; do \
-+              sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:\1;:;p}' $$files ; \
-+      done >> $@ ; \
-+      echo "show_stats; print_nl; print_tm; parse_rtattr; parse_rtattr_flags; get_u32; matches; addattr_l; addattr_nest; addattr_nest_end; };" >> $@
-+
- endif
index 765e4ad2e8726af2fccde801f2dcb4ec3e65954a..545075fd85748777878ef0228c51d4afbc869b86 100644 (file)
@@ -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
  
index 8156adbf050fca4d67309f129a2982661f5adad1..6ecf5568be37db78b3c2c23cd96a130c3c6aa8ba 100644 (file)
@@ -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 $@
index 92bf5cb66d875d6402ee2954aeeb17e4dac72f5c..e41be20f108f8eb64732f5951ddb26120474d131 100644 (file)
@@ -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
index a611ba75f0f18d6b3ce953d4ee2c1abd403e57d7..36ecc735a74d4a7a44ae23fa4d4c8680619dfb71 100644 (file)
@@ -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 (file)
index 8b40ffe..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-From 69e3b2fadcd32683db2942f31fe41f0fbb2185f8 Mon Sep 17 00:00:00 2001
-From: Stephen Hemminger <stephen@networkplumber.org>
-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 <stephen@networkplumber.org>
----
- 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 (file)
index c65d94b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-From 64ed1886e719f40acb554ac895305acb43f27bea Mon Sep 17 00:00:00 2001
-From: Pedro Tammela <pctammela@mojatatu.com>
-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 <pctammela@mojatatu.com>
-Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
----
- 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 <stdarg.h>
- #include <limits.h>
- #include <assert.h>
-+#include <libgen.h>
- #ifdef HAVE_ELF
- #include <libelf.h>