Skip to content

Commit

Permalink
kernel: enable conntrack counter updates for iptables xt_FLOWOFFLOAD
Browse files Browse the repository at this point in the history
Ensures that packet/byte counters in /proc/net/nf_conntrack are updated

Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nbd168 committed Mar 24, 2023
1 parent 808014c commit f84c940
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o
--- /dev/null
+++ b/net/netfilter/xt_FLOWOFFLOAD.c
@@ -0,0 +1,697 @@
@@ -0,0 +1,698 @@
+/*
+ * Copyright (C) 2018-2021 Felix Fietkau <nbd@nbd.name>
+ *
Expand Down Expand Up @@ -752,6 +752,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+{
+ INIT_DELAYED_WORK(&tbl->work, xt_flowoffload_hook_work);
+ tbl->ft.type = &flowtable_inet;
+ tbl->ft.flags = NF_FLOWTABLE_COUNTER;
+
+ return nf_flow_table_init(&tbl->ft);
+}
Expand All @@ -770,7 +771,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ if (ret)
+ 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);
+ if (ret)
Expand Down

0 comments on commit f84c940

Please sign in to comment.