package/iproute2: rollback to 5.10.0 for bpf compat
This commit is contained in:
parent
80e4109cff
commit
78091d7431
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=iproute2
|
||||
PKG_VERSION:=5.11.0
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=5.10.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
|
||||
PKG_HASH:=c5e2ea108212b3445051b35953ec267f9f3469e1d5c67ac034ab559849505c54
|
||||
PKG_HASH:=a54a34ae309c0406b2d1fb3a46158613ffb83d33fefd5d4a27f0010237ac53e9
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_DEPENDS:=iptables
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
@ -33,8 +33,8 @@ endef
|
||||
|
||||
define Package/ip-tiny
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Routing control utility (minimal)
|
||||
VARIANT:=iptiny
|
||||
TITLE:=Routing control utility (Minimal)
|
||||
VARIANT:=tiny
|
||||
DEFAULT_VARIANT:=1
|
||||
PROVIDES:=ip
|
||||
ALTERNATIVES:=200:/sbin/ip:/usr/libexec/ip-tiny
|
||||
@ -43,92 +43,68 @@ endef
|
||||
|
||||
define Package/ip-full
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Routing control utility (full)
|
||||
VARIANT:=ipfull
|
||||
TITLE:=Routing control utility (Full)
|
||||
VARIANT:=full
|
||||
PROVIDES:=ip
|
||||
ALTERNATIVES:=300:/sbin/ip:/usr/libexec/ip-full
|
||||
DEPENDS:=+libnl-tiny +libbpf +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
DEPENDS:=+libnl-tiny +libelf +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
endef
|
||||
|
||||
define Package/tc-tiny
|
||||
define Package/tc
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Traffic control utility (minimal)
|
||||
VARIANT:=tctiny
|
||||
DEFAULT_VARIANT:=1
|
||||
TITLE:=Traffic control utility
|
||||
VARIANT:=tc
|
||||
PROVIDES:=tc
|
||||
ALTERNATIVES:=200:/sbin/tc:/usr/libexec/tc-tiny
|
||||
DEPENDS:=+kmod-sched-core +libxtables +tc-mod-iptables +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
endef
|
||||
|
||||
define Package/tc-full
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Traffic control utility (full)
|
||||
VARIANT:=tcfull
|
||||
PROVIDES:=tc
|
||||
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
|
||||
DEPENDS:=+libxtables
|
||||
DEPENDS:=+kmod-sched-core +libxtables +libelf +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
endef
|
||||
|
||||
define Package/genl
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=General netlink utility frontend
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
|
||||
endef
|
||||
|
||||
define Package/ip-bridge
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Bridge configuration utility from iproute2
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
|
||||
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 +(PACKAGE_tc||PACKAGE_ip-full):libelf +kmod-netlink-diag
|
||||
endef
|
||||
|
||||
define Package/nstat
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Network statistics utility
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
|
||||
endef
|
||||
|
||||
define Package/devlink
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Network devlink utility
|
||||
DEPENDS:=+libmnl
|
||||
DEPENDS:=+libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
|
||||
endef
|
||||
|
||||
define Package/rdma
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Network rdma utility
|
||||
DEPENDS:=+libmnl
|
||||
DEPENDS:=+libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_VARIANT),iptiny)
|
||||
ifeq ($(BUILD_VARIANT),tiny)
|
||||
IP_CONFIG_TINY:=y
|
||||
LIBBPF_FORCE:=off
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),ipfull)
|
||||
ifeq ($(BUILD_VARIANT),full)
|
||||
HAVE_ELF:=y
|
||||
LIBBPF_FORCE:=on
|
||||
HAVE_CAP:=n
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),tctiny)
|
||||
LIBBPF_FORCE:=off
|
||||
SHARED_LIBS:=y
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),tcfull)
|
||||
ifeq ($(BUILD_VARIANT),tc)
|
||||
HAVE_ELF:=y
|
||||
LIBBPF_FORCE:=on
|
||||
SHARED_LIBS:=y
|
||||
endif
|
||||
|
||||
@ -146,29 +122,26 @@ define Build/Configure
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections
|
||||
TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
|
||||
|
||||
MAKE_FLAGS += \
|
||||
KERNEL_INCLUDE="$(LINUX_DIR)/user_headers/include" \
|
||||
SHARED_LIBS=$(SHARED_LIBS) \
|
||||
IP_CONFIG_TINY=$(IP_CONFIG_TINY) \
|
||||
LIBBPF_FORCE=$(LIBBPF_FORCE) \
|
||||
HAVE_ELF=$(HAVE_ELF) \
|
||||
HAVE_MNL=$(HAVE_MNL) \
|
||||
HAVE_CAP=$(HAVE_CAP) \
|
||||
IPT_LIB_DIR=/usr/lib/iptables \
|
||||
XT_LIB_DIR=/usr/lib/iptables \
|
||||
FPIC="$(FPIC)" \
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='')
|
||||
FPIC="$(FPIC)"
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/iproute2
|
||||
$(CP) $(PKG_BUILD_DIR)/include/bpf_elf.h $(1)/usr/include/iproute2
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_BUILD_DIR)/include/{libgenl,libnetlink}.h $(1)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
|
||||
@ -184,19 +157,13 @@ define Package/ip-full/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/libexec/ip-full
|
||||
endef
|
||||
|
||||
define Package/tc-tiny/install
|
||||
$(INSTALL_DIR) $(1)/usr/libexec
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/libexec/tc-tiny
|
||||
endef
|
||||
|
||||
define Package/tc-full/install
|
||||
$(INSTALL_DIR) $(1)/usr/libexec
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/libexec/tc-full
|
||||
endef
|
||||
|
||||
define Package/tc-mod-iptables/install
|
||||
define Package/tc/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
|
||||
ifeq ($(SHARED_LIBS),y)
|
||||
$(INSTALL_DIR) $(1)/usr/lib/tc
|
||||
$(CP) $(PKG_BUILD_DIR)/tc/m_xt.so $(1)/usr/lib/tc
|
||||
$(CP) $(PKG_BUILD_DIR)/tc/*.so $(1)/usr/lib/tc
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/genl/install
|
||||
@ -231,9 +198,7 @@ endef
|
||||
|
||||
$(eval $(call BuildPackage,ip-tiny))
|
||||
$(eval $(call BuildPackage,ip-full))
|
||||
$(eval $(call BuildPackage,tc-tiny))
|
||||
$(eval $(call BuildPackage,tc-full))
|
||||
$(eval $(call BuildPackage,tc-mod-iptables))
|
||||
$(eval $(call BuildPackage,tc))
|
||||
$(eval $(call BuildPackage,genl))
|
||||
$(eval $(call BuildPackage,ip-bridge))
|
||||
$(eval $(call BuildPackage,ss))
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -39,7 +39,8 @@ int main(int argc, char **argv) {
|
||||
@@ -34,7 +34,8 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
EOF
|
||||
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS)
|
||||
YACCFLAGS = -d -t -v
|
||||
|
||||
-SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma dcb man
|
||||
+SUBDIRS=lib ip tc bridge misc genl tipc devlink rdma dcb man
|
||||
-SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma man
|
||||
+SUBDIRS=lib ip tc bridge misc genl tipc devlink rdma man
|
||||
|
||||
LIBNETLINK=../lib/libutil.a ../lib/libnetlink.a
|
||||
LDLIBS += $(LIBNETLINK)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/tc/q_fifo.c
|
||||
+++ b/tc/q_fifo.c
|
||||
@@ -95,5 +95,6 @@ struct qdisc_util pfifo_head_drop_qdisc_
|
||||
@@ -99,5 +99,6 @@ struct qdisc_util pfifo_head_drop_qdisc_
|
||||
|
||||
struct qdisc_util pfifo_fast_qdisc_util = {
|
||||
.id = "pfifo_fast",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -367,7 +367,7 @@ check_selinux()
|
||||
@@ -257,7 +257,7 @@ check_selinux()
|
||||
|
||||
check_mnl()
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -235,7 +235,7 @@ EOF
|
||||
@@ -230,7 +230,7 @@ EOF
|
||||
|
||||
check_elf()
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -425,7 +425,7 @@ EOF
|
||||
@@ -315,7 +315,7 @@ EOF
|
||||
|
||||
check_cap()
|
||||
{
|
||||
|
||||
@ -7,5 +7,5 @@
|
||||
-CFLAGS += -fPIC
|
||||
+CFLAGS += $(FPIC)
|
||||
|
||||
UTILOBJ = utils.o utils_math.o rt_names.o ll_map.o ll_types.o ll_proto.o ll_addr.o \
|
||||
inet_proto.o namespace.o json_writer.o json_print.o json_print_math.o \
|
||||
UTILOBJ = utils.o rt_names.o ll_map.o ll_types.o ll_proto.o ll_addr.o \
|
||||
inet_proto.o namespace.o json_writer.o json_print.o \
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
|
||||
--- a/ip/ip.c
|
||||
+++ b/ip/ip.c
|
||||
@@ -64,10 +64,16 @@ static void usage(void)
|
||||
@@ -48,10 +48,16 @@ static void usage(void)
|
||||
fprintf(stderr,
|
||||
"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
|
||||
" ip [ -force ] -batch filename\n"
|
||||
@ -42,7 +42,7 @@
|
||||
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
|
||||
" -h[uman-readable] | -iec | -j[son] | -p[retty] |\n"
|
||||
" -f[amily] { inet | inet6 | mpls | bridge | link } |\n"
|
||||
@@ -90,36 +96,50 @@ static const struct cmd {
|
||||
@@ -74,36 +80,50 @@ static const struct cmd {
|
||||
int (*func)(int argc, char **argv);
|
||||
} cmds[] = {
|
||||
{ "address", do_ipaddr },
|
||||
@ -103,6 +103,6 @@
|
||||
+ CFLAGS += -DIPROUTE2_TINY
|
||||
+endif
|
||||
+
|
||||
UTILOBJ = utils.o utils_math.o rt_names.o ll_map.o ll_types.o ll_proto.o ll_addr.o \
|
||||
inet_proto.o namespace.o json_writer.o json_print.o json_print_math.o \
|
||||
names.o color.o bpf_legacy.o bpf_glue.o exec.o fs.o cg_map.o
|
||||
UTILOBJ = utils.o rt_names.o ll_map.o ll_types.o ll_proto.o ll_addr.o \
|
||||
inet_proto.o namespace.o json_writer.o json_print.o \
|
||||
names.o color.o bpf.o exec.o fs.o cg_map.o
|
||||
|
||||
@ -26,14 +26,13 @@
|
||||
|
||||
q_atm.so: q_atm.c
|
||||
$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
|
||||
@@ -205,4 +206,16 @@ static-syms.h: $(wildcard *.c)
|
||||
@@ -205,4 +206,15 @@ 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 "{" > $@ ; \
|
||||
|
||||
@ -1,45 +0,0 @@
|
||||
From c77310119f9a5f99221dd967c5eb0c7a26094b41 Mon Sep 17 00:00:00 2001
|
||||
From: Tony Ambardar <Tony.Ambardar@gmail.com>
|
||||
Date: Wed, 3 Mar 2021 10:29:24 -0800
|
||||
Subject: [PATCH] lib/bpf: add missing limits.h includes
|
||||
|
||||
Several functions in bpf_glue.c and bpf_libbpf.c rely on PATH_MAX, which is
|
||||
normally included from <limits.h> in other iproute2 source files.
|
||||
|
||||
It fixes errors seen using gcc 10.2.0, binutils 2.35.1 and musl 1.1.24:
|
||||
|
||||
bpf_glue.c: In function 'get_libbpf_version':
|
||||
bpf_glue.c:46:11: error: 'PATH_MAX' undeclared (first use in this function);
|
||||
did you mean 'AF_MAX'?
|
||||
46 | char buf[PATH_MAX], *s;
|
||||
| ^~~~~~~~
|
||||
| AF_MAX
|
||||
|
||||
Reported-by: Rui Salvaterra <rsalvaterra@gmail.com>
|
||||
Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
|
||||
---
|
||||
lib/bpf_glue.c | 2 ++
|
||||
lib/bpf_libbpf.c | 1 +
|
||||
2 files changed, 3 insertions(+)
|
||||
|
||||
--- a/lib/bpf_glue.c
|
||||
+++ b/lib/bpf_glue.c
|
||||
@@ -4,6 +4,8 @@
|
||||
* Authors: Hangbin Liu <haliu@redhat.com>
|
||||
*
|
||||
*/
|
||||
+#include <limits.h>
|
||||
+
|
||||
#include "bpf_util.h"
|
||||
#ifdef HAVE_LIBBPF
|
||||
#include <bpf/bpf.h>
|
||||
--- a/lib/bpf_libbpf.c
|
||||
+++ b/lib/bpf_libbpf.c
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <stdint.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
+#include <limits.h>
|
||||
|
||||
#include <libelf.h>
|
||||
#include <gelf.h>
|
||||
@ -1,20 +0,0 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -259,7 +259,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
EOF
|
||||
|
||||
- $CC -o $TMPDIR/libbpf_test $TMPDIR/libbpf_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS >/dev/null 2>&1
|
||||
+ $CC -o $TMPDIR/libbpf_test $TMPDIR/libbpf_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS $LDFLAGS >/dev/null 2>&1
|
||||
local ret=$?
|
||||
|
||||
rm -f $TMPDIR/libbpf_test.c $TMPDIR/libbpf_test
|
||||
@@ -277,7 +277,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
EOF
|
||||
|
||||
- $CC -o $TMPDIR/libbpf_sec_test $TMPDIR/libbpf_sec_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS >/dev/null 2>&1
|
||||
+ $CC -o $TMPDIR/libbpf_sec_test $TMPDIR/libbpf_sec_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS $LDFLAGS >/dev/null 2>&1
|
||||
local ret=$?
|
||||
|
||||
rm -f $TMPDIR/libbpf_sec_test.c $TMPDIR/libbpf_sec_test
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -411,14 +411,8 @@ EOF
|
||||
@@ -301,14 +301,8 @@ EOF
|
||||
if $CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1; then
|
||||
echo "no"
|
||||
else
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -354,7 +354,7 @@ check_libbpf()
|
||||
@@ -244,7 +244,7 @@ check_elf()
|
||||
check_selinux()
|
||||
# SELinux is a compile time option in the ss utility
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user