include $(TOPDIR)/rules.mk
PKG_NAME:=iproute2
-PKG_VERSION:=5.10.0
+PKG_VERSION:=5.11.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
-PKG_HASH:=a54a34ae309c0406b2d1fb3a46158613ffb83d33fefd5d4a27f0010237ac53e9
+PKG_HASH:=c5e2ea108212b3445051b35953ec267f9f3469e1d5c67ac034ab559849505c54
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=iptables
PKG_LICENSE:=GPL-2.0
VARIANT:=full
PROVIDES:=ip
ALTERNATIVES:=300:/sbin/ip:/usr/libexec/ip-full
- DEPENDS:=+libnl-tiny +libelf +(PACKAGE_devlink||PACKAGE_rdma):libmnl
+ DEPENDS:=+libnl-tiny +libbpf +(PACKAGE_devlink||PACKAGE_rdma):libmnl
endef
define Package/tc
TITLE:=Traffic control utility
VARIANT:=tc
PROVIDES:=tc
- DEPENDS:=+kmod-sched-core +libxtables +libelf +(PACKAGE_devlink||PACKAGE_rdma):libmnl
+ DEPENDS:=+kmod-sched-core +libxtables +libbpf +(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 +(PACKAGE_tc||PACKAGE_ip-full):libelf
+ DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
endef
define Package/ip-bridge
$(call Package/iproute2/Default)
TITLE:=Bridge configuration utility from iproute2
- DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
+ DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
endef
define Package/ss
$(call Package/iproute2/Default)
TITLE:=Socket statistics utility
- DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf +kmod-netlink-diag
+ DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +kmod-netlink-diag
endef
define Package/nstat
$(call Package/iproute2/Default)
TITLE:=Network statistics utility
- DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
+ DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
endef
define Package/devlink
$(call Package/iproute2/Default)
TITLE:=Network devlink utility
- DEPENDS:=+libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
+ DEPENDS:=+libmnl
endef
define Package/rdma
$(call Package/iproute2/Default)
TITLE:=Network rdma utility
- DEPENDS:=+libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
+ DEPENDS:=+libmnl
endef
ifeq ($(BUILD_VARIANT),tiny)
IP_CONFIG_TINY:=y
+ LIBBPF_FORCE:=off
endif
ifeq ($(BUILD_VARIANT),full)
HAVE_ELF:=y
+ LIBBPF_FORCE:=on
HAVE_CAP:=n
endif
ifeq ($(BUILD_VARIANT),tc)
HAVE_ELF:=y
+ LIBBPF_FORCE:=on
SHARED_LIBS:=y
endif
endef
TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed
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)"
+ FPIC="$(FPIC)" \
+ $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='')
define Build/Compile
+$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS)
endef
define Build/InstallDev
- $(INSTALL_DIR) $(1)/usr/include
+ $(INSTALL_DIR) $(1)/usr/include/iproute2
+ $(CP) $(PKG_BUILD_DIR)/include/bpf_elf.h $(1)/usr/include/iproute2
$(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/
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
-@@ -48,10 +48,16 @@ static void usage(void)
+@@ -64,10 +64,16 @@ static void usage(void)
fprintf(stderr,
"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
" ip [ -force ] -batch filename\n"
" 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"
-@@ -74,36 +80,50 @@ static const struct cmd {
+@@ -90,36 +96,50 @@ static const struct cmd {
int (*func)(int argc, char **argv);
} cmds[] = {
{ "address", do_ipaddr },
+ CFLAGS += -DIPROUTE2_TINY
+endif
+
- 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
+ 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