iproute2: reset to f0dd52, fix #13
This commit is contained in:
parent
eccde70cd4
commit
d9a431abff
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=iproute2
|
||||
PKG_VERSION:=4.18.0
|
||||
PKG_RELEASE:=4
|
||||
PKG_VERSION:=5.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
|
||||
PKG_HASH:=a9e6c70c95f513871c5e1f4e452c04fcb3c4d8a05be651bd794cd994a52daa45
|
||||
PKG_HASH:=df047302a39650ef832c07e8dab5df7a23218cd398bd310c8628e386161d20ba
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_DEPENDS:=iptables
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
@ -23,6 +23,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSI
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/iproute2/Default
|
||||
SECTION:=net
|
||||
@ -36,9 +37,10 @@ define Package/ip-tiny
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Routing control utility (Minimal)
|
||||
VARIANT:=tiny
|
||||
DEFAULT_VARIANT:=1
|
||||
PROVIDES:=ip
|
||||
ALTERNATIVES:=200:/sbin/ip:/sbin/ip-tiny
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libelf
|
||||
ALTERNATIVES:=200:/sbin/ip:/usr/libexec/ip-tiny
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
endef
|
||||
|
||||
define Package/ip-full
|
||||
@ -46,56 +48,67 @@ $(call Package/iproute2/Default)
|
||||
TITLE:=Routing control utility (Full)
|
||||
VARIANT:=full
|
||||
PROVIDES:=ip
|
||||
ALTERNATIVES:=300:/sbin/ip:/sbin/ip-full
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libelf
|
||||
ALTERNATIVES:=300:/sbin/ip:/usr/libexec/ip-full
|
||||
DEPENDS:=+libnl-tiny +libelf +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
endef
|
||||
|
||||
define Package/tc
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Traffic control utility
|
||||
DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libelf
|
||||
VARIANT:=tc
|
||||
PROVIDES:=tc
|
||||
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 +libelf
|
||||
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 +libelf
|
||||
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 +libelf
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
|
||||
endef
|
||||
|
||||
define Package/nstat
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Network statistics utility
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libelf
|
||||
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 +libelf
|
||||
DEPENDS:=+libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
|
||||
endef
|
||||
|
||||
define Package/rdma
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Network rdma utility
|
||||
DEPENDS:=+libmnl +libelf
|
||||
DEPENDS:=+libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_VARIANT),tiny)
|
||||
IP_CONFIG_TINY:=y
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),full)
|
||||
HAVE_ELF:=y
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),tc)
|
||||
HAVE_ELF:=y
|
||||
SHARED_LIBS:=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_PACKAGE_devlink
|
||||
HAVE_MNL:=y
|
||||
endif
|
||||
@ -105,25 +118,22 @@ ifdef CONFIG_PACKAGE_rdma
|
||||
endif
|
||||
|
||||
define Build/Configure
|
||||
$(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
|
||||
$(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
|
||||
$(PKG_BUILD_DIR)/Makefile
|
||||
$(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
|
||||
$(PKG_BUILD_DIR)/Makefile
|
||||
echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-openwrt\";" \
|
||||
> $(PKG_BUILD_DIR)/include/SNAPSHOT.h
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections
|
||||
TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
|
||||
|
||||
MAKE_FLAGS += \
|
||||
EXTRA_CCOPTS="-I$(STAGING_DIR)/usr/include/libnl-tiny" \
|
||||
KERNEL_INCLUDE="$(LINUX_DIR)/include" \
|
||||
SHARED_LIBS="" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections" \
|
||||
KERNEL_INCLUDE="$(LINUX_DIR)/user_headers/include" \
|
||||
SHARED_LIBS=$(SHARED_LIBS) \
|
||||
IP_CONFIG_TINY=$(IP_CONFIG_TINY) \
|
||||
HAVE_ELF=$(HAVE_ELF) \
|
||||
HAVE_MNL=$(HAVE_MNL) \
|
||||
IPT_LIB_DIR=/usr/lib/iptables \
|
||||
XT_LIB_DIR=/usr/lib/iptables \
|
||||
FPIC="$(FPIC)"
|
||||
|
||||
define Build/Compile
|
||||
@ -138,13 +148,13 @@ define Build/InstallDev
|
||||
endef
|
||||
|
||||
define Package/ip-tiny/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/sbin/ip-tiny
|
||||
$(INSTALL_DIR) $(1)/usr/libexec
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/libexec/ip-tiny
|
||||
endef
|
||||
|
||||
define Package/ip-full/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/sbin/ip-full
|
||||
$(INSTALL_DIR) $(1)/usr/libexec
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/libexec/ip-full
|
||||
endef
|
||||
|
||||
define Package/tc/install
|
||||
@ -152,6 +162,10 @@ define Package/tc/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) ./files/15-teql $(1)/etc/hotplug.d/iface/
|
||||
ifeq ($(SHARED_LIBS),y)
|
||||
$(INSTALL_DIR) $(1)/usr/lib/tc
|
||||
$(CP) $(PKG_BUILD_DIR)/tc/*.so $(1)/usr/lib/tc
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/genl/install
|
||||
|
||||
0
package/network/utils/iproute2/files/15-teql
Executable file → Normal file
0
package/network/utils/iproute2/files/15-teql
Executable file → Normal file
152
package/network/utils/iproute2/patches/010-cake-fwmark.patch
Normal file
152
package/network/utils/iproute2/patches/010-cake-fwmark.patch
Normal file
@ -0,0 +1,152 @@
|
||||
From a7cd7badedcb643dc1adb41edeb4cf8e4d9ec063 Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Hemminger <stephen@networkplumber.org>
|
||||
Date: Tue, 19 Mar 2019 10:36:56 -0700
|
||||
Subject: uapi: add CAKE FWMARK
|
||||
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
---
|
||||
include/uapi/linux/pkt_sched.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
|
||||
index 1eb572e..7ee74c3 100644
|
||||
--- a/include/uapi/linux/pkt_sched.h
|
||||
+++ b/include/uapi/linux/pkt_sched.h
|
||||
@@ -1021,6 +1021,7 @@ enum {
|
||||
TCA_CAKE_INGRESS,
|
||||
TCA_CAKE_ACK_FILTER,
|
||||
TCA_CAKE_SPLIT_GSO,
|
||||
+ TCA_CAKE_FWMARK,
|
||||
__TCA_CAKE_MAX
|
||||
};
|
||||
#define TCA_CAKE_MAX (__TCA_CAKE_MAX - 1)
|
||||
|
||||
From 5ebfe1f6fea2bb3bfccf4cf93829516caaa0233d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@toke.dk>
|
||||
Date: Mon, 18 Mar 2019 01:30:45 +0100
|
||||
Subject: [PATCH] q_cake: Add support for setting the fwmark option
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This adds support for the newly added fwmark option to CAKE, which allows
|
||||
overriding the tin selection from the per-packet firewall marks. The fwmark
|
||||
field is a bitmask that is applied to the fwmark to select the tin.
|
||||
|
||||
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
|
||||
---
|
||||
man/man8/tc-cake.8 | 16 ++++++++++++++++
|
||||
tc/q_cake.c | 24 ++++++++++++++++++++++++
|
||||
2 files changed, 40 insertions(+)
|
||||
|
||||
diff --git a/man/man8/tc-cake.8 b/man/man8/tc-cake.8
|
||||
index eda436e1..8c57eadd 100644
|
||||
--- a/man/man8/tc-cake.8
|
||||
+++ b/man/man8/tc-cake.8
|
||||
@@ -91,6 +91,10 @@ TIME |
|
||||
LIMIT ]
|
||||
.br
|
||||
[
|
||||
+.BR fwmark
|
||||
+MASK ]
|
||||
+.br
|
||||
+[
|
||||
.BR ptm
|
||||
|
|
||||
.BR atm
|
||||
@@ -524,6 +528,18 @@ preset on the modern Internet is firmly discouraged.
|
||||
.br
|
||||
Voice (CS7, CS6, EF, VA, TOS4), 25% threshold, reduced Codel interval.
|
||||
|
||||
+.PP
|
||||
+.B fwmark
|
||||
+MASK
|
||||
+.br
|
||||
+ This options turns on fwmark-based overriding of CAKE's tin selection.
|
||||
+If set, the option specifies a bitmask that will be applied to the fwmark
|
||||
+associated with each packet. If the result of this masking is non-zero, the
|
||||
+result will be right-shifted by the number of least-significant unset bits in
|
||||
+the mask value, and the result will be used as a the tin number for that packet.
|
||||
+This can be used to set policies in a firewall script that will override CAKE's
|
||||
+built-in tin selection.
|
||||
+
|
||||
.SH OTHER PARAMETERS
|
||||
.B memlimit
|
||||
LIMIT
|
||||
diff --git a/tc/q_cake.c b/tc/q_cake.c
|
||||
index e827e3f1..307a12c0 100644
|
||||
--- a/tc/q_cake.c
|
||||
+++ b/tc/q_cake.c
|
||||
@@ -82,6 +82,7 @@ static void explain(void)
|
||||
" [ split-gso* | no-split-gso ]\n"
|
||||
" [ ack-filter | ack-filter-aggressive | no-ack-filter* ]\n"
|
||||
" [ memlimit LIMIT ]\n"
|
||||
+" [ fwmark MASK ]\n"
|
||||
" [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ]\n"
|
||||
" [ mpu N ] [ ingress | egress* ]\n"
|
||||
" (* marks defaults)\n");
|
||||
@@ -106,6 +107,7 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
|
||||
int autorate = -1;
|
||||
int ingress = -1;
|
||||
int overhead = 0;
|
||||
+ int fwmark = -1;
|
||||
int wash = -1;
|
||||
int nat = -1;
|
||||
int atm = -1;
|
||||
@@ -332,6 +334,16 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
|
||||
"Illegal value for \"memlimit\": \"%s\"\n", *argv);
|
||||
return -1;
|
||||
}
|
||||
+ } else if (strcmp(*argv, "fwmark") == 0) {
|
||||
+ unsigned int fwm;
|
||||
+
|
||||
+ NEXT_ARG();
|
||||
+ if (get_u32(&fwm, *argv, 0)) {
|
||||
+ fprintf(stderr,
|
||||
+ "Illegal value for \"fwmark\": \"%s\"\n", *argv);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ fwmark = fwm;
|
||||
} else if (strcmp(*argv, "help") == 0) {
|
||||
explain();
|
||||
return -1;
|
||||
@@ -376,6 +388,9 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
|
||||
if (memlimit)
|
||||
addattr_l(n, 1024, TCA_CAKE_MEMORY, &memlimit,
|
||||
sizeof(memlimit));
|
||||
+ if (fwmark != -1)
|
||||
+ addattr_l(n, 1024, TCA_CAKE_FWMARK, &fwmark,
|
||||
+ sizeof(fwmark));
|
||||
if (nat != -1)
|
||||
addattr_l(n, 1024, TCA_CAKE_NAT, &nat, sizeof(nat));
|
||||
if (wash != -1)
|
||||
@@ -409,6 +424,7 @@ static int cake_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
|
||||
struct rtattr *tb[TCA_CAKE_MAX + 1];
|
||||
unsigned int interval = 0;
|
||||
unsigned int memlimit = 0;
|
||||
+ unsigned int fwmark = 0;
|
||||
__u64 bandwidth = 0;
|
||||
int ack_filter = 0;
|
||||
int split_gso = 0;
|
||||
@@ -507,6 +523,10 @@ static int cake_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
|
||||
RTA_PAYLOAD(tb[TCA_CAKE_RTT]) >= sizeof(__u32)) {
|
||||
interval = rta_getattr_u32(tb[TCA_CAKE_RTT]);
|
||||
}
|
||||
+ if (tb[TCA_CAKE_FWMARK] &&
|
||||
+ RTA_PAYLOAD(tb[TCA_CAKE_FWMARK]) >= sizeof(__u32)) {
|
||||
+ fwmark = rta_getattr_u32(tb[TCA_CAKE_FWMARK]);
|
||||
+ }
|
||||
|
||||
if (wash)
|
||||
print_string(PRINT_FP, NULL, "wash ", NULL);
|
||||
@@ -559,6 +579,10 @@ static int cake_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
|
||||
sprint_size(memlimit, b1));
|
||||
}
|
||||
|
||||
+ if (fwmark)
|
||||
+ print_uint(PRINT_FP, NULL, "fwmark 0x%x ", fwmark);
|
||||
+ print_0xhex(PRINT_JSON, "fwmark", NULL, fwmark);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
--- /dev/null
|
||||
+++ b/Config
|
||||
@@ -0,0 +1,4 @@
|
||||
+# Fixed config to disable ATM support even if present on host system
|
||||
+IP_CONFIG_SETNS:=y
|
||||
+TC_CONFIG_ATM:=n
|
||||
+TC_CONFIG_XT:=y
|
||||
12
package/network/utils/iproute2/patches/100-configure.patch
Normal file
12
package/network/utils/iproute2/patches/100-configure.patch
Normal file
@ -0,0 +1,12 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -32,7 +32,8 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
EOF
|
||||
|
||||
- if $CC -I$INCLUDE -o $TMPDIR/atmtest $TMPDIR/atmtest.c -latm >/dev/null 2>&1; then
|
||||
+# OpenWrt: disable ATM support even if present on host system
|
||||
+ if [ 1 -eq 0 ]; then
|
||||
echo "TC_CONFIG_ATM:=y" >>$CONFIG
|
||||
echo yes
|
||||
else
|
||||
@ -0,0 +1,12 @@
|
||||
--- a/tc/Makefile
|
||||
+++ b/tc/Makefile
|
||||
@@ -120,6 +120,9 @@ CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PR
|
||||
ifneq ($(IPT_LIB_DIR),)
|
||||
CFLAGS += -DIPT_LIB_DIR=\"$(IPT_LIB_DIR)\"
|
||||
endif
|
||||
+ifneq ($(XT_LIB_DIR),)
|
||||
+ CFLAGS += -DXT_LIB_DIR=\"$(XT_LIB_DIR)\"
|
||||
+endif
|
||||
|
||||
YACC := bison
|
||||
LEX := flex
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -61,7 +61,7 @@ WFLAGS += -Wmissing-declarations -Wold-s
|
||||
@@ -55,7 +55,7 @@ WFLAGS += -Wmissing-declarations -Wold-s
|
||||
CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS)
|
||||
YACCFLAGS = -d -t -v
|
||||
|
||||
|
||||
@ -0,0 +1,101 @@
|
||||
Description: Sync header from iptables
|
||||
The current versions in several suites have the same content:
|
||||
- 1.6.1-2 (unstable)
|
||||
Bug: https://bugs.debian.org/868059
|
||||
Forwarded: not-needed
|
||||
Author: Cyril Brulebois <cyril@debamax.com>
|
||||
Last-Update: 2017-11-22
|
||||
--- a/include/xtables.h
|
||||
+++ b/include/xtables.h
|
||||
@@ -206,9 +206,24 @@ enum xtables_ext_flags {
|
||||
XTABLES_EXT_ALIAS = 1 << 0,
|
||||
};
|
||||
|
||||
+struct xt_xlate;
|
||||
+
|
||||
+struct xt_xlate_mt_params {
|
||||
+ const void *ip;
|
||||
+ const struct xt_entry_match *match;
|
||||
+ int numeric;
|
||||
+ bool escape_quotes;
|
||||
+};
|
||||
+
|
||||
+struct xt_xlate_tg_params {
|
||||
+ const void *ip;
|
||||
+ const struct xt_entry_target *target;
|
||||
+ int numeric;
|
||||
+ bool escape_quotes;
|
||||
+};
|
||||
+
|
||||
/* Include file for additions: new matches and targets. */
|
||||
-struct xtables_match
|
||||
-{
|
||||
+struct xtables_match {
|
||||
/*
|
||||
* ABI/API version this module requires. Must be first member,
|
||||
* as the rest of this struct may be subject to ABI changes.
|
||||
@@ -270,6 +285,10 @@ struct xtables_match
|
||||
void (*x6_fcheck)(struct xt_fcheck_call *);
|
||||
const struct xt_option_entry *x6_options;
|
||||
|
||||
+ /* Translate iptables to nft */
|
||||
+ int (*xlate)(struct xt_xlate *xl,
|
||||
+ const struct xt_xlate_mt_params *params);
|
||||
+
|
||||
/* Size of per-extension instance extra "global" scratch space */
|
||||
size_t udata_size;
|
||||
|
||||
@@ -281,8 +300,7 @@ struct xtables_match
|
||||
unsigned int loaded; /* simulate loading so options are merged properly */
|
||||
};
|
||||
|
||||
-struct xtables_target
|
||||
-{
|
||||
+struct xtables_target {
|
||||
/*
|
||||
* ABI/API version this module requires. Must be first member,
|
||||
* as the rest of this struct may be subject to ABI changes.
|
||||
@@ -347,6 +365,10 @@ struct xtables_target
|
||||
void (*x6_fcheck)(struct xt_fcheck_call *);
|
||||
const struct xt_option_entry *x6_options;
|
||||
|
||||
+ /* Translate iptables to nft */
|
||||
+ int (*xlate)(struct xt_xlate *xl,
|
||||
+ const struct xt_xlate_tg_params *params);
|
||||
+
|
||||
size_t udata_size;
|
||||
|
||||
/* Ignore these men behind the curtain: */
|
||||
@@ -407,6 +429,17 @@ struct xtables_globals
|
||||
|
||||
#define XT_GETOPT_TABLEEND {.name = NULL, .has_arg = false}
|
||||
|
||||
+/*
|
||||
+ * enum op-
|
||||
+ *
|
||||
+ * For writing clean nftables translations code
|
||||
+ */
|
||||
+enum xt_op {
|
||||
+ XT_OP_EQ,
|
||||
+ XT_OP_NEQ,
|
||||
+ XT_OP_MAX,
|
||||
+};
|
||||
+
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -549,6 +582,14 @@ extern void xtables_lmap_free(struct xta
|
||||
extern int xtables_lmap_name2id(const struct xtables_lmap *, const char *);
|
||||
extern const char *xtables_lmap_id2name(const struct xtables_lmap *, int);
|
||||
|
||||
+/* xlate infrastructure */
|
||||
+struct xt_xlate *xt_xlate_alloc(int size);
|
||||
+void xt_xlate_free(struct xt_xlate *xl);
|
||||
+void xt_xlate_add(struct xt_xlate *xl, const char *fmt, ...);
|
||||
+void xt_xlate_add_comment(struct xt_xlate *xl, const char *comment);
|
||||
+const char *xt_xlate_get_comment(struct xt_xlate *xl);
|
||||
+const char *xt_xlate_get(struct xt_xlate *xl);
|
||||
+
|
||||
#ifdef XTABLES_INTERNAL
|
||||
|
||||
/* Shipped modules rely on this... */
|
||||
@ -1,7 +1,7 @@
|
||||
--- a/tc/q_fifo.c
|
||||
+++ b/tc/q_fifo.c
|
||||
@@ -97,5 +97,6 @@ struct qdisc_util pfifo_head_drop_qdisc_
|
||||
extern int prio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt);
|
||||
@@ -99,5 +99,6 @@ struct qdisc_util pfifo_head_drop_qdisc_
|
||||
|
||||
struct qdisc_util pfifo_fast_qdisc_util = {
|
||||
.id = "pfifo_fast",
|
||||
+ .parse_qopt = fifo_parse_opt,
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -281,7 +281,7 @@ check_selinux()
|
||||
@@ -255,7 +255,7 @@ check_selinux()
|
||||
|
||||
check_mnl()
|
||||
{
|
||||
- if ${PKG_CONFIG} libmnl --exists
|
||||
+ if [ "${HAVE_MNL}" = "y" ] && ${PKG_CONFIG} libmnl --exists
|
||||
then
|
||||
- if ${PKG_CONFIG} libmnl --exists; then
|
||||
+ if [ "${HAVE_MNL}" = "y" ] && ${PKG_CONFIG} libmnl --exists; then
|
||||
echo "HAVE_MNL:=y" >>$CONFIG
|
||||
echo "yes"
|
||||
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -228,7 +228,7 @@ EOF
|
||||
|
||||
check_elf()
|
||||
{
|
||||
- if ${PKG_CONFIG} libelf --exists; then
|
||||
+ if [ "${HAVE_ELF}" = "y" ] && ${PKG_CONFIG} libelf --exists; then
|
||||
echo "HAVE_ELF:=y" >>$CONFIG
|
||||
echo "yes"
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -54,7 +54,7 @@ HOSTCC ?= $(CC)
|
||||
DEFINES += -D_GNU_SOURCE
|
||||
# Turn on transparent support for LFS
|
||||
DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
|
||||
-CCOPTS = -O2
|
||||
+CCOPTS = -O2 $(EXTRA_CCOPTS)
|
||||
WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes
|
||||
WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2
|
||||
|
||||
@ -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
|
||||
@@ -48,10 +48,16 @@ static void usage(void)
|
||||
@@ -47,10 +47,16 @@ static void usage(void)
|
||||
fprintf(stderr,
|
||||
"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
|
||||
" ip [ -force ] -batch filename\n"
|
||||
@ -41,8 +41,8 @@
|
||||
+#endif
|
||||
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
|
||||
" -h[uman-readable] | -iec | -j[son] | -p[retty] |\n"
|
||||
" -f[amily] { inet | inet6 | ipx | dnet | mpls | bridge | link } |\n"
|
||||
@@ -73,32 +79,44 @@ static const struct cmd {
|
||||
" -f[amily] { inet | inet6 | mpls | bridge | link } |\n"
|
||||
@@ -72,32 +78,44 @@ static const struct cmd {
|
||||
int (*func)(int argc, char **argv);
|
||||
} cmds[] = {
|
||||
{ "address", do_ipaddr },
|
||||
@ -87,24 +87,6 @@
|
||||
{ "vrf", do_ipvrf},
|
||||
{ "sr", do_seg6 },
|
||||
{ "help", do_help },
|
||||
--- a/lib/utils.c
|
||||
+++ b/lib/utils.c
|
||||
@@ -1010,6 +1010,7 @@ const char *rt_addr_n2a_r(int af, int le
|
||||
return inet_ntop(af, addr, buf, buflen);
|
||||
case AF_MPLS:
|
||||
return mpls_ntop(af, addr, buf, buflen);
|
||||
+#ifndef IPROUTE2_TINY
|
||||
case AF_IPX:
|
||||
return ipx_ntop(af, addr, buf, buflen);
|
||||
case AF_DECnet:
|
||||
@@ -1019,6 +1020,7 @@ const char *rt_addr_n2a_r(int af, int le
|
||||
memcpy(dna.a_addr, addr, 2);
|
||||
return dnet_ntop(af, &dna, buf, buflen);
|
||||
}
|
||||
+#endif
|
||||
case AF_PACKET:
|
||||
return ll_addr_n2a(addr, len, ARPHRD_VOID, buf, buflen);
|
||||
case AF_BRIDGE:
|
||||
--- a/lib/Makefile
|
||||
+++ b/lib/Makefile
|
||||
@@ -3,6 +3,10 @@ include ../config.mk
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
--- a/tc/Makefile
|
||||
+++ b/tc/Makefile
|
||||
@@ -107,7 +107,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
|
||||
@@ -137,7 +137,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 $@ $^
|
||||
@@ -159,6 +159,7 @@ install: all
|
||||
clean:
|
||||
rm -f $(TCOBJ) $(TCLIB) libtc.a tc *.so emp_ematch.yacc.h; \
|
||||
rm -f emp_ematch.yacc.*
|
||||
+ rm -f dynsyms.list
|
||||
|
||||
q_atm.so: q_atm.c
|
||||
$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
|
||||
@@ -198,4 +199,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
|
||||
+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_tm; parse_rtattr; get_u32; matches; addattr_l; addattr_nest; addattr_nest_end; };" >> $@
|
||||
+
|
||||
endif
|
||||
@ -31,7 +31,7 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY
|
||||
if (!end || end == arg || *end || res > 255)
|
||||
--- a/include/uapi/linux/rtnetlink.h
|
||||
+++ b/include/uapi/linux/rtnetlink.h
|
||||
@@ -221,6 +221,7 @@ enum {
|
||||
@@ -228,6 +228,7 @@ enum {
|
||||
RTN_THROW, /* Not in this table */
|
||||
RTN_NAT, /* Translate this address */
|
||||
RTN_XRESOLVE, /* Use external resolver */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,19 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -299,14 +299,8 @@ EOF
|
||||
if $CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1; then
|
||||
echo "no"
|
||||
else
|
||||
- if ${PKG_CONFIG} libbsd --exists; then
|
||||
- echo 'CFLAGS += -DHAVE_LIBBSD' `${PKG_CONFIG} libbsd --cflags` >>$CONFIG
|
||||
- echo 'LDLIBS +=' `${PKG_CONFIG} libbsd --libs` >> $CONFIG
|
||||
- echo "no"
|
||||
- else
|
||||
- echo 'CFLAGS += -DNEED_STRLCPY' >>$CONFIG
|
||||
- echo "yes"
|
||||
- fi
|
||||
+ echo 'CFLAGS += -DNEED_STRLCPY' >>$CONFIG
|
||||
+ echo "yes"
|
||||
fi
|
||||
rm -f $TMPDIR/strtest.c $TMPDIR/strtest
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user