lede/package/qca/qca-ssdk/patches/0011-add-kernel-5.4-support.patch
2022-09-12 13:48:20 +08:00

109 lines
3.4 KiB
Diff

--- a/app/nathelper/linux/lib/nat_helper_dt.c
+++ b/app/nathelper/linux/lib/nat_helper_dt.c
@@ -721,7 +721,7 @@ napt_ct_counter_sync(a_uint32_t hw_index)
}
if (!test_bit(IPS_FIXED_TIMEOUT_BIT, &ct->status)) {
- ct->timeout.expires += delta_jiffies;
+ ct->timeout += delta_jiffies;
}
if((cct != NULL) && (napt_hw_get_by_index(&napt, hw_index) == 0))
@@ -770,7 +770,7 @@ napt_ct_timer_update(a_uint32_t hw_index)
}
if (!test_bit(IPS_FIXED_TIMEOUT_BIT, &ct->status)) {
- ct->timeout.expires += delta_jiffies;
+ ct->timeout += delta_jiffies;
}
return 0;
--- a/app/nathelper/linux/napt_helper.c
+++ b/app/nathelper/linux/napt_helper.c
@@ -64,11 +64,6 @@ napt_ct_aging_disable(uint32_t ct_addr)
}
ct = (struct nf_conn *)ct_addr;
-
- if (timer_pending(&ct->timeout))
- {
- del_timer(&ct->timeout);
- }
}
int
@@ -85,7 +80,7 @@ napt_ct_aging_is_enable(uint32_t ct_addr)
ct = (struct nf_conn *)ct_addr;
- return timer_pending(&(((struct nf_conn *)ct)->timeout));
+ return (nf_ct_is_expired(ct));
}
void
@@ -111,18 +106,17 @@ napt_ct_aging_enable(uint32_t ct_addr)
l3num = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.l3num;
protonum = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum;
- ct->timeout.expires = jiffies+10*HZ;
+ ct->timeout = jiffies+10*HZ;
if ((l3num == AF_INET) && (protonum == IPPROTO_TCP))
{
if (ct->proto.tcp.state == TCP_CONNTRACK_ESTABLISHED)
{
- ct->timeout.expires = jiffies+(5*24*60*60*HZ);
+ ct->timeout = jiffies+(5*24*60*60*HZ);
}
}
HNAT_PRINTK("<aging> ct:[%x] add timeout again\n", ct_addr);
- add_timer(&ct->timeout);
}
void
@@ -339,7 +333,6 @@ napt_ct_list_unlock(void)
uint32_t
napt_ct_list_iterate(uint32_t *hash, uint32_t *iterate)
{
- struct net *net = &init_net;
struct nf_conntrack_tuple_hash *h = NULL;
struct nf_conn *ct = NULL;
struct hlist_nulls_node *pos = (struct hlist_nulls_node *) (*iterate);
@@ -349,7 +342,7 @@ napt_ct_list_iterate(uint32_t *hash, uint32_t *iterate)
if(pos == 0)
{
/*get head for list*/
- pos = rcu_dereference((&net->ct.hash[*hash])->first);
+ pos = rcu_dereference(hlist_nulls_first_rcu(&nf_conntrack_hash[*hash]));
}
hlist_nulls_for_each_entry_from(h, pos, hnnode)
--- a/app/nathelper/linux/nat_ipt_helper.c
+++ b/app/nathelper/linux/nat_ipt_helper.c
@@ -534,10 +534,10 @@ nat_ipt_data_init(void)
memset(&old_replace, 0, sizeof (old_replace));
/*record ipt rule(SNAT) sequence for hw nat*/
- memset(hw_nat_ipt_seq, 0, NAT_HW_NUM);
+ memset(hw_nat_ipt_seq, 0, sizeof(hw_nat_ipt_seq));
/*record ipt rule(SNAT) pubip index for hw nat*/
- memset(hw_nat_pip_idx, 0, NAT_HW_NUM);
+ memset(hw_nat_pip_idx, 0, sizeof(hw_nat_pip_idx));
}
static void
--- a/make/linux_opt.mk
+++ b/make/linux_opt.mk
@@ -449,9 +449,6 @@ ifeq (KSLIB, $(MODULE_TYPE))
else ifeq ($(ARCH), arm)
MODULE_INC += -I$(SYS_PATH) \
-I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \
- -I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/7.5.0/include/ \
- -I$(TOOL_PATH)/../../lib/armv7a-vfp-neon-rdk-linux-gnueabi/gcc/arm-rdk-linux-gnueabi/4.8.4/include/ \
- -I$(TOOL_PATH)/../../lib/arm-rdk-linux-musleabi/gcc/arm-rdk-linux-musleabi/6.4.0/include/ \
-I$(SYS_PATH)/include \
-I$(SYS_PATH)/source \
-I$(SYS_PATH)/source/include \