From 25ea8c9967e1daac08b3258e0cc779772a31fada Mon Sep 17 00:00:00 2001 From: suyuan168 <175338101@qq.com> Date: Tue, 3 May 2022 17:43:13 +0800 Subject: [PATCH] Revert "fix" This reverts commit 160ff7018b58911a2d9fb195148ffc91147aa3bd. --- iproute2/Makefile | 55 ++------- iproute2/patches/170-ip_tiny.patch | 110 ------------------ .../patches/195-build_variant_ip_tc.patch | 22 ---- xtables-addons/Makefile | 8 +- .../001-fix-kernel-version-detection.patch | 4 +- .../patches/200-add-lua-packetscript.patch | 12 +- 6 files changed, 22 insertions(+), 189 deletions(-) delete mode 100644 iproute2/patches/170-ip_tiny.patch delete mode 100644 iproute2/patches/195-build_variant_ip_tc.patch diff --git a/iproute2/Makefile b/iproute2/Makefile index 55c00a0d6..1405f0752 100644 --- a/iproute2/Makefile +++ b/iproute2/Makefile @@ -8,12 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 -PKG_VERSION:=5.15.0 PKG_RELEASE:=$(AUTORELEASE) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 -PKG_HASH:=38e3e4a5f9a7f5575c015027a10df097c149111eeb739993128e5b2b35b291ff +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://git.kernel.org/pub/scm/network/iproute2/iproute2.git +PKG_SOURCE_VERSION:=29da83f89f6e1fe528c59131a01f5d43bcd0a000 +PKG_VERSION:=5.16.0-$(PKG_SOURCE_VERSION) + PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=iptables PKG_LICENSE:=GPL-2.0 @@ -57,16 +58,7 @@ $(call Package/iproute2/Default) DEFAULT_VARIANT:=1 PROVIDES:=tc ALTERNATIVES:=200:/sbin/tc:/usr/libexec/tc-tiny - DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl -endef - -define Package/tc-bpf -$(call Package/iproute2/Default) - TITLE:=Traffic control utility (bpf) - VARIANT:=tcbpf - PROVIDES:=tc - ALTERNATIVES:=300:/sbin/tc:/usr/libexec/tc-bpf - DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libbpf + DEPENDS:=+kmod-sched-core +libxtables +tc-mod-iptables +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/tc-full @@ -74,14 +66,13 @@ $(call Package/iproute2/Default) TITLE:=Traffic control utility (full) 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 + ALTERNATIVES:=300:/sbin/tc:/usr/libexec/tc-full + DEPENDS:=+kmod-sched-core +libxtables +tc-mod-iptables +libbpf +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/tc-mod-iptables $(call Package/iproute2/Default) TITLE:=Traffic control module - iptables action - VARIANT:=tcfull DEPENDS:=+libxtables endef @@ -133,29 +124,13 @@ endif ifeq ($(BUILD_VARIANT),tctiny) LIBBPF_FORCE:=off -endif - -ifeq ($(BUILD_VARIANT),tcbpf) - HAVE_ELF:=y - LIBBPF_FORCE:=on SHARED_LIBS:=y endif ifeq ($(BUILD_VARIANT),tcfull) - #enable iptables/xtables requirement only if tciptables variant is selected - TC_CONFIG_XT:=y - TC_CONFIG_XT_OLD:=y - TC_CONFIG_XT_OLD_H:=y - TC_CONFIG_IPSET:=y HAVE_ELF:=y LIBBPF_FORCE:=on SHARED_LIBS:=y -else - #disable iptables requirement by default - TC_CONFIG_XT:=n - TC_CONFIG_XT_OLD:=n - TC_CONFIG_XT_OLD_H:=n - TC_CONFIG_IPSET:=n endif ifdef CONFIG_PACKAGE_devlink @@ -186,10 +161,6 @@ MAKE_FLAGS += \ HAVE_CAP=$(HAVE_CAP) \ IPT_LIB_DIR=/usr/lib/iptables \ XT_LIB_DIR=/usr/lib/iptables \ - TC_CONFIG_XT=$(TC_CONFIG_XT) \ - TC_CONFIG_XT_OLD=$(TC_CONFIG_XT_OLD) \ - TC_CONFIG_XT_OLD_H=$(TC_CONFIG_XT_OLD_H) \ - TC_CONFIG_IPSET=$(TC_CONFIG_IPSET) \ FPIC="$(FPIC)" \ $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') @@ -220,11 +191,6 @@ define Package/tc-tiny/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/libexec/tc-tiny endef -define Package/tc-bpf/install - $(INSTALL_DIR) $(1)/usr/libexec - $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/libexec/tc-bpf -endef - define Package/tc-full/install $(INSTALL_DIR) $(1)/usr/libexec $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/libexec/tc-full @@ -265,13 +231,12 @@ define Package/rdma/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/rdma/rdma $(1)/usr/sbin/ endef -$(eval $(call BuildPackage,ip-tiny)) +#$(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-tiny)) $(eval $(call BuildPackage,tc-full)) $(eval $(call BuildPackage,genl)) $(eval $(call BuildPackage,ip-bridge)) diff --git a/iproute2/patches/170-ip_tiny.patch b/iproute2/patches/170-ip_tiny.patch deleted file mode 100644 index cd687e760..000000000 --- a/iproute2/patches/170-ip_tiny.patch +++ /dev/null @@ -1,110 +0,0 @@ ---- a/ip/Makefile -+++ b/ip/Makefile -@@ -17,6 +17,13 @@ RTMONOBJ=rtmon.o - - include ../config.mk - -+STATIC_SYM_FILTER:= -+ifeq ($(IP_CONFIG_TINY),y) -+ STATIC_SYM_FILTER:=iplink_can.c iplink_ipoib.c iplink_vxlan.c -+ CFLAGS += -DIPROUTE2_TINY -+endif -+STATIC_SYM_SOURCES:=$(filter-out $(STATIC_SYM_FILTER),$(wildcard *.c)) -+ - ALLOBJ=$(IPOBJ) $(RTMONOBJ) - SCRIPTS=ifcfg rtpr routel routef - TARGETS=ip rtmon -@@ -46,7 +53,7 @@ else - - ip: static-syms.o - static-syms.o: static-syms.h --static-syms.h: $(wildcard *.c) -+static-syms.h: $(STATIC_SYM_SOURCES) - files="$^" ; \ - for s in `grep -B 3 '\data; + + info->state_id = 0; -+ strcpy(info->function, "process_packet\0"); ++ strncpy(info->function, "process_packet\0", sizeof("process_packet\0")); +} + +static int @@ -5301,7 +5301,7 @@ + case OP_FORLOOP: + case OP_FORPREP: + checkreg(pt, a+3); -+ fallthrough; ++ /* go through */ + case OP_JMP: { + int dest = pc+1+b; + /* not full check and jump is forward and do not skip `lastpc'? */ @@ -7716,7 +7716,6 @@ + } + else if (sep == -1) return '['; + else luaX_lexerror(ls, "invalid long string delimiter", TK_STRING); -+ fallthrough; + } + case '=': { + next(ls); @@ -7810,6 +7809,7 @@ + lua_assert(ls->lookahead.token == TK_EOS); + ls->lookahead.token = llex(ls, &ls->lookahead.seminfo); +} ++ --- /dev/null +++ b/extensions/LUA/lua/llex.h @@ -0,0 +1,81 @@ @@ -12471,7 +12471,7 @@ + lua_number2int(k, n); + if (luai_numeq(cast_num(k), nvalue(key))) /* index is int? */ + return luaH_getnum(t, k); /* use specialized version */ -+ fallthrough; ++ /* else go through */ + } + default: { + Node *n = mainposition(t, key); @@ -12766,7 +12766,7 @@ + if (!lua_isstring(L, -1)) + luaL_error(L, "invalid value (%s) at index %d in table for " + LUA_QL("concat"), luaL_typename(L, -1), i); -+ luaL_addvalue(b); ++ luaL_addvalue(b); +} + + @@ -17984,7 +17984,7 @@ + int32_t ret; + struct lua_env * env = kmalloc(sizeof(struct lua_env), GFP_KERNEL); + -+ if (!script_size) { ++ if (!script_size > 0) { + pr_debug("LUA [%d]: script_size %lu < 0\n", state_id, script_size); + return false; + }