Skip to content

Commit 7e274cb

Browse files
authored
Merge pull request coolsnowwolf#9938 from breakings/iproute2
2 parents 3c6c5fa + a350a1c commit 7e274cb

14 files changed

+110
-34
lines changed

package/network/utils/iproute2/Makefile

+42-5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
include $(TOPDIR)/rules.mk
99

1010
PKG_NAME:=iproute2
11-
PKG_VERSION:=5.15.0
11+
PKG_VERSION:=5.19.0
1212
PKG_RELEASE:=$(AUTORELEASE)
1313

1414
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
1515
PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
16-
PKG_HASH:=38e3e4a5f9a7f5575c015027a10df097c149111eeb739993128e5b2b35b291ff
16+
PKG_HASH:=26b7a34d6a7fd2f7a42e2b39c5a90cb61bac522d1096067ffeb195e5693d7791
1717
PKG_BUILD_PARALLEL:=1
1818
PKG_BUILD_DEPENDS:=iptables
1919
PKG_LICENSE:=GPL-2.0
@@ -57,21 +57,31 @@ $(call Package/iproute2/Default)
5757
DEFAULT_VARIANT:=1
5858
PROVIDES:=tc
5959
ALTERNATIVES:=200:/sbin/tc:/usr/libexec/tc-tiny
60-
DEPENDS:=+kmod-sched-core +libxtables +tc-mod-iptables +(PACKAGE_devlink||PACKAGE_rdma):libmnl
60+
DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl
61+
endef
62+
63+
define Package/tc-bpf
64+
$(call Package/iproute2/Default)
65+
TITLE:=Traffic control utility (bpf)
66+
VARIANT:=tcbpf
67+
PROVIDES:=tc
68+
ALTERNATIVES:=300:/sbin/tc:/usr/libexec/tc-bpf
69+
DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libbpf
6170
endef
6271

6372
define Package/tc-full
6473
$(call Package/iproute2/Default)
6574
TITLE:=Traffic control utility (full)
6675
VARIANT:=tcfull
6776
PROVIDES:=tc
68-
ALTERNATIVES:=300:/sbin/tc:/usr/libexec/tc-full
69-
DEPENDS:=+kmod-sched-core +libxtables +tc-mod-iptables +libbpf +(PACKAGE_devlink||PACKAGE_rdma):libmnl
77+
ALTERNATIVES:=400:/sbin/tc:/usr/libexec/tc-full
78+
DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libbpf +libxtables +tc-mod-iptables
7079
endef
7180

7281
define Package/tc-mod-iptables
7382
$(call Package/iproute2/Default)
7483
TITLE:=Traffic control module - iptables action
84+
VARIANT:=tcfull
7585
DEPENDS:=+libxtables
7686
endef
7787

@@ -123,13 +133,29 @@ endif
123133

124134
ifeq ($(BUILD_VARIANT),tctiny)
125135
LIBBPF_FORCE:=off
136+
endif
137+
138+
ifeq ($(BUILD_VARIANT),tcbpf)
139+
HAVE_ELF:=y
140+
LIBBPF_FORCE:=on
126141
SHARED_LIBS:=y
127142
endif
128143

129144
ifeq ($(BUILD_VARIANT),tcfull)
145+
#enable iptables/xtables requirement only if tciptables variant is selected
146+
TC_CONFIG_XT:=y
147+
TC_CONFIG_XT_OLD:=y
148+
TC_CONFIG_XT_OLD_H:=y
149+
TC_CONFIG_IPSET:=y
130150
HAVE_ELF:=y
131151
LIBBPF_FORCE:=on
132152
SHARED_LIBS:=y
153+
else
154+
#disable iptables requirement by default
155+
TC_CONFIG_XT:=n
156+
TC_CONFIG_XT_OLD:=n
157+
TC_CONFIG_XT_OLD_H:=n
158+
TC_CONFIG_IPSET:=n
133159
endif
134160

135161
ifdef CONFIG_PACKAGE_devlink
@@ -158,8 +184,13 @@ MAKE_FLAGS += \
158184
HAVE_ELF=$(HAVE_ELF) \
159185
HAVE_MNL=$(HAVE_MNL) \
160186
HAVE_CAP=$(HAVE_CAP) \
187+
HAVE_TIRPC=n \
161188
IPT_LIB_DIR=/usr/lib/iptables \
162189
XT_LIB_DIR=/usr/lib/iptables \
190+
TC_CONFIG_XT=$(TC_CONFIG_XT) \
191+
TC_CONFIG_XT_OLD=$(TC_CONFIG_XT_OLD) \
192+
TC_CONFIG_XT_OLD_H=$(TC_CONFIG_XT_OLD_H) \
193+
TC_CONFIG_IPSET=$(TC_CONFIG_IPSET) \
163194
FPIC="$(FPIC)" \
164195
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='')
165196

@@ -190,6 +221,11 @@ define Package/tc-tiny/install
190221
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/libexec/tc-tiny
191222
endef
192223

224+
define Package/tc-bpf/install
225+
$(INSTALL_DIR) $(1)/usr/libexec
226+
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/libexec/tc-bpf
227+
endef
228+
193229
define Package/tc-full/install
194230
$(INSTALL_DIR) $(1)/usr/libexec
195231
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/libexec/tc-full
@@ -236,6 +272,7 @@ $(eval $(call BuildPackage,ip-full))
236272
# spurious rebuilds when building multiple variants.
237273
$(eval $(call BuildPackage,tc-mod-iptables))
238274
$(eval $(call BuildPackage,tc-tiny))
275+
$(eval $(call BuildPackage,tc-bpf))
239276
$(eval $(call BuildPackage,tc-full))
240277
$(eval $(call BuildPackage,genl))
241278
$(eval $(call BuildPackage,ip-bridge))

package/network/utils/iproute2/patches/100-configure.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/configure
22
+++ b/configure
3-
@@ -34,7 +34,8 @@ int main(int argc, char **argv) {
3+
@@ -36,7 +36,8 @@ int main(int argc, char **argv) {
44
}
55
EOF
66

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From c69e8e474936795a2cd7638b11ce3e99ff4d5ae7 Mon Sep 17 00:00:00 2001
2+
From: Nick Hainke <[email protected]>
3+
Date: Sat, 6 Aug 2022 10:00:20 +0200
4+
Subject: [PATCH] ipstats: Define MIN function to fix undefined references
5+
6+
Fixes errors in the form of:
7+
in function `ipstats_show_64':
8+
<artificial>:(.text+0x4e30): undefined reference to `MIN'
9+
10+
Signed-off-by: Nick Hainke <[email protected]>
11+
---
12+
ip/ipstats.c | 4 ++++
13+
1 file changed, 4 insertions(+)
14+
15+
--- a/ip/ipstats.c
16+
+++ b/ip/ipstats.c
17+
@@ -6,6 +6,10 @@
18+
#include "utils.h"
19+
#include "ip_common.h"
20+
21+
+#ifndef MIN
22+
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
23+
+#endif
24+
+
25+
struct ipstats_stat_dump_filters {
26+
/* mask[0] filters outer attributes. Then individual nests have their
27+
* filtering mask at the index of the nested attribute.

package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
--- a/Makefile
22
+++ b/Makefile
3-
@@ -55,7 +55,7 @@ WFLAGS += -Wmissing-declarations -Wold-s
3+
@@ -65,9 +65,9 @@ WFLAGS += -Wmissing-declarations -Wold-s
44
CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS)
55
YACCFLAGS = -d -t -v
66

7-
-SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma dcb man vdpa
8-
+SUBDIRS=lib ip tc bridge misc genl devlink rdma
7+
-SUBDIRS=lib ip tc bridge misc netem genl man
8+
+SUBDIRS=lib ip tc bridge misc genl
9+
ifeq ($(HAVE_MNL),y)
10+
-SUBDIRS += tipc devlink rdma dcb vdpa
11+
+SUBDIRS += devlink rdma
12+
endif
913

1014
LIBNETLINK=../lib/libutil.a ../lib/libnetlink.a
11-
LDLIBS += $(LIBNETLINK)

package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/configure
22
+++ b/configure
3-
@@ -387,7 +387,7 @@ check_selinux()
3+
@@ -411,7 +411,7 @@ check_tirpc()
44

55
check_mnl()
66
{

package/network/utils/iproute2/patches/145-keep_libelf_optional.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/configure
22
+++ b/configure
3-
@@ -255,7 +255,7 @@ EOF
3+
@@ -266,7 +266,7 @@ EOF
44

55
check_elf()
66
{

package/network/utils/iproute2/patches/150-keep_libcap_optional.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/configure
22
+++ b/configure
3-
@@ -445,7 +445,7 @@ EOF
3+
@@ -469,7 +469,7 @@ EOF
44

55
check_cap()
66
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/configure
2+
+++ b/configure
3+
@@ -398,7 +398,7 @@ check_selinux()
4+
5+
check_tirpc()
6+
{
7+
- if ${PKG_CONFIG} libtirpc --exists; then
8+
+ if [ "${HAVE_TIRPC}" = "y" ] && ${PKG_CONFIG} libtirpc --exists; then
9+
echo "HAVE_RPC:=y" >>$CONFIG
10+
echo "yes"
11+

package/network/utils/iproute2/patches/170-ip_tiny.patch

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/ip/Makefile
22
+++ b/ip/Makefile
3-
@@ -17,6 +17,13 @@ RTMONOBJ=rtmon.o
3+
@@ -19,6 +19,13 @@ RTMONOBJ=rtmon.o
44

55
include ../config.mk
66

@@ -12,9 +12,9 @@
1212
+STATIC_SYM_SOURCES:=$(filter-out $(STATIC_SYM_FILTER),$(wildcard *.c))
1313
+
1414
ALLOBJ=$(IPOBJ) $(RTMONOBJ)
15-
SCRIPTS=ifcfg rtpr routel routef
15+
SCRIPTS=routel
1616
TARGETS=ip rtmon
17-
@@ -46,7 +53,7 @@ else
17+
@@ -48,7 +55,7 @@ else
1818

1919
ip: static-syms.o
2020
static-syms.o: static-syms.h
@@ -30,20 +30,20 @@
3030
"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
3131
" ip [ -force ] -batch filename\n"
3232
+#ifndef IPROUTE2_TINY
33-
"where OBJECT := { address | addrlabel | fou | help | ila | ioam | l2tp | link |\n"
34-
" macsec | maddress | monitor | mptcp | mroute | mrule |\n"
33+
"where OBJECT := { address | addrlabel | amt | fou | help | ila | ioam | l2tp |\n"
34+
" link | macsec | maddress | monitor | mptcp | mroute | mrule |\n"
3535
" neighbor | neighbour | netconf | netns | nexthop | ntable |\n"
3636
" ntbl | route | rule | sr | tap | tcpmetrics |\n"
3737
" token | tunnel | tuntap | vrf | xfrm }\n"
3838
+#else
39-
+ "where OBJECT := { address | ila | link | macsec | maddress | monitor |\n"
40-
+ " mroute | mrule | neighbor | neighbour | netns | route |\n"
41-
+ " rule | sr | token | tunnel | vrf }\n"
39+
+ "where OBJECT := { address | link | maddress | monitor |\n"
40+
+ " neighbor | neighbour | netns | route |\n"
41+
+ " rule | token | tunnel }\n"
4242
+#endif
4343
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
4444
" -h[uman-readable] | -iec | -j[son] | -p[retty] |\n"
4545
" -f[amily] { inet | inet6 | mpls | bridge | link } |\n"
46-
@@ -91,37 +97,51 @@ static const struct cmd {
46+
@@ -91,37 +97,49 @@ static const struct cmd {
4747
int (*func)(int argc, char **argv);
4848
} cmds[] = {
4949
{ "address", do_ipaddr },
@@ -63,9 +63,9 @@
6363
+#ifndef IPROUTE2_TINY
6464
{ "l2tp", do_ipl2tp },
6565
{ "fou", do_ipfou },
66-
+#endif
6766
{ "ila", do_ipila },
6867
{ "macsec", do_ipmacsec },
68+
+#endif
6969
{ "tunnel", do_iptunnel },
7070
{ "tunl", do_iptunnel },
7171
+#ifndef IPROUTE2_TINY
@@ -78,23 +78,21 @@
7878
{ "monitor", do_ipmonitor },
7979
+#ifndef IPROUTE2_TINY
8080
{ "xfrm", do_xfrm },
81-
+#endif
8281
{ "mroute", do_multiroute },
8382
{ "mrule", do_multirule },
83+
+#endif
8484
{ "netns", do_netns },
8585
+#ifndef IPROUTE2_TINY
8686
{ "netconf", do_ipnetconf },
87-
+#endif
8887
{ "vrf", do_ipvrf},
8988
{ "sr", do_seg6 },
90-
+#ifndef IPROUTE2_TINY
9189
{ "nexthop", do_ipnh },
9290
{ "mptcp", do_mptcp },
9391
{ "ioam", do_ioam6 },
9492
+#endif
9593
{ "help", do_help },
94+
{ "stats", do_ipstats },
9695
{ 0 }
97-
};
9896
--- a/lib/Makefile
9997
+++ b/lib/Makefile
10098
@@ -3,6 +3,10 @@ include ../config.mk

package/network/utils/iproute2/patches/180-drop_FAILED_POLICY.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY
3131
if (!end || end == arg || *end || res > 255)
3232
--- a/include/uapi/linux/rtnetlink.h
3333
+++ b/include/uapi/linux/rtnetlink.h
34-
@@ -256,6 +256,7 @@ enum {
34+
@@ -265,6 +265,7 @@ enum {
3535
RTN_THROW, /* Not in this table */
3636
RTN_NAT, /* Translate this address */
3737
RTN_XRESOLVE, /* Use external resolver */

package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/configure
22
+++ b/configure
3-
@@ -279,7 +279,7 @@ int main(int argc, char **argv) {
3+
@@ -290,7 +290,7 @@ int main(int argc, char **argv) {
44
}
55
EOF
66

@@ -9,7 +9,7 @@
99
local ret=$?
1010

1111
rm -f $TMPDIR/libbpf_test.c $TMPDIR/libbpf_test
12-
@@ -297,7 +297,7 @@ int main(int argc, char **argv) {
12+
@@ -308,7 +308,7 @@ int main(int argc, char **argv) {
1313
}
1414
EOF
1515

package/network/utils/iproute2/patches/195-build_variant_ip_tc.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
--- a/ip/Makefile
22
+++ b/ip/Makefile
3-
@@ -26,7 +26,7 @@ STATIC_SYM_SOURCES:=$(filter-out $(STATI
3+
@@ -28,7 +28,7 @@ STATIC_SYM_SOURCES:=$(filter-out $(STATI
44

55
ALLOBJ=$(IPOBJ) $(RTMONOBJ)
6-
SCRIPTS=ifcfg rtpr routel routef
6+
SCRIPTS=routel
77
-TARGETS=ip rtmon
88
+TARGETS=$(findstring ip,$(BUILD_VARIANT)) rtmon
99

package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/configure
22
+++ b/configure
3-
@@ -431,14 +431,8 @@ EOF
3+
@@ -455,14 +455,8 @@ EOF
44
if $CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1; then
55
echo "no"
66
else

package/network/utils/iproute2/patches/300-selinux-configurable.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/configure
22
+++ b/configure
3-
@@ -374,7 +374,7 @@ check_libbpf()
3+
@@ -385,7 +385,7 @@ check_libbpf()
44
check_selinux()
55
# SELinux is a compile time option in the ss utility
66
{

0 commit comments

Comments
 (0)