Browse Source

kernel: enable conntrack counter updates for iptables xt_FLOWOFFLOAD

Ensures that packet/byte counters in /proc/net/nf_conntrack are updated

Signed-off-by: Felix Fietkau <[email protected]>
Felix Fietkau 2 years ago
parent
commit
f84c94060f

+ 3 - 2
target/linux/generic/hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch

@@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
  obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o
  obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o
 --- /dev/null
 --- /dev/null
 +++ b/net/netfilter/xt_FLOWOFFLOAD.c
 +++ b/net/netfilter/xt_FLOWOFFLOAD.c
-@@ -0,0 +1,697 @@
+@@ -0,0 +1,698 @@
 +/*
 +/*
 + * Copyright (C) 2018-2021 Felix Fietkau <[email protected]>
 + * Copyright (C) 2018-2021 Felix Fietkau <[email protected]>
 + *
 + *
@@ -752,6 +752,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
 +{
 +{
 +	INIT_DELAYED_WORK(&tbl->work, xt_flowoffload_hook_work);
 +	INIT_DELAYED_WORK(&tbl->work, xt_flowoffload_hook_work);
 +	tbl->ft.type = &flowtable_inet;
 +	tbl->ft.type = &flowtable_inet;
++	tbl->ft.flags = NF_FLOWTABLE_COUNTER;
 +
 +
 +	return nf_flow_table_init(&tbl->ft);
 +	return nf_flow_table_init(&tbl->ft);
 +}
 +}
@@ -770,7 +771,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
 +	if (ret)
 +	if (ret)
 +		goto cleanup;
 +		goto cleanup;
 +
 +
-+	flowtable[1].ft.flags = NF_FLOWTABLE_HW_OFFLOAD;
++	flowtable[1].ft.flags |= NF_FLOWTABLE_HW_OFFLOAD;
 +
 +
 +	ret = xt_register_target(&offload_tg_reg);
 +	ret = xt_register_target(&offload_tg_reg);
 +	if (ret)
 +	if (ret)