From 97b90d7413b57b7fcb7d86c3d09dfd981781a75e Mon Sep 17 00:00:00 2001 From: Kevin Bracey Date: Mon, 13 Dec 2021 20:01:50 +0200 Subject: [PATCH] Use iptables 1.4.14 with kernel 2.6.22 --- release/src/router/Makefile | 11 ++++------ .../include/linux/netfilter/xt_ethport.h | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 release/src/router/iptables-1.4.x/include/linux/netfilter/xt_ethport.h diff --git a/release/src/router/Makefile b/release/src/router/Makefile index 7c225228e7..e4aa62c764 100755 --- a/release/src/router/Makefile +++ b/release/src/router/Makefile @@ -133,17 +133,14 @@ ifeq ($(RTCONFIG_DSL),y) obj-y += dsl_drv_tool endif -ifneq ($(or $(findstring linux-2.6.36,$(LINUXDIR)),$(findstring linux-3.x,$(LINUXDIR))),) IPTABLES := iptables-1.4.x IPTC_LIBDIR := $(TOP)/$(IPTABLES)/libiptc/.libs IPTC_LIBS := -lip4tc $(if $(RTCONFIG_IGD2), $(if $(RTCONFIG_IPV6),-lip6tc,),) -liptc obj-y += iptables-1.4.x + +ifneq ($(or $(findstring linux-2.6.36,$(LINUXDIR)),$(findstring linux-3.x,$(LINUXDIR))),) obj-y += iproute2-3.x else -IPTABLES := iptables -IPTC_LIBDIR := $(TOP)/$(IPTABLES) -IPTC_LIBS := -liptc -obj-y += iptables obj-y += iproute2 endif @@ -511,8 +508,8 @@ obj-y += openssl-1.1 # include for all builds obj-y += haveged obj-y += udp-broadcast-relay-redux obj-y += socat -ifneq ($(or $(findstring linux-2.6.36,$(LINUXDIR)),$(findstring linux-3.x,$(LINUXDIR))),) obj-y += libnfnetlink-1.0.1 +ifneq ($(or $(findstring linux-2.6.36,$(LINUXDIR)),$(findstring linux-3.x,$(LINUXDIR))),) obj-y += libmnl-1.0.4 obj-y += ipset-7 else @@ -1617,7 +1614,7 @@ iptables-1.4.x-clean: libnfnetlink/stamp-h1: # tomatoraf.com, Victek - cd $(TOP)/libnfnetlink && CC=$(CC) STRIP=$(STRIP) \ + cd $(TOP)/libnfnetlink && CC=$(CC) STRIP="$(STRIP)" \ CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections" \ LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \ $(CONFIGURE) --prefix=/usr --enable-shared --enable-static diff --git a/release/src/router/iptables-1.4.x/include/linux/netfilter/xt_ethport.h b/release/src/router/iptables-1.4.x/include/linux/netfilter/xt_ethport.h new file mode 100644 index 0000000000..51a6174c7f --- /dev/null +++ b/release/src/router/iptables-1.4.x/include/linux/netfilter/xt_ethport.h @@ -0,0 +1,20 @@ +/* x_tables module for matching the IPv4/IPv6 DSCP field + * + * (C) 2002 Harald Welte + * This software is distributed under GNU GPL v2, 1991 + * + * xt_ethport.h, 2009/06/09 +*/ +#ifndef _XT_ETHPORT_H +#define _XT_ETHPORT_H + +#define XT_SKB_CB_OFFSET 0x24 /* store port number info in skb->cb[0x24] */ +#define XT_ETHPORT_MAX 0x8 /* port 0-5 && cpu port(port6)*/ + +/* match info */ +struct xt_ethport_info { + u_int8_t portnum; + u_int8_t invert; +}; + +#endif /* _XT_ETHPORT_H */