nf_flow_tab...d_ct_timeout(9)
πΈ hey bestie, welcome to nf_flow_tab...d_ct_timeout(9) πΈ
okay so this is a page from the Kernel API Manual, and it's all about one lil function that keeps your offloaded conntrack entries from getting yeeted before their time. it's giving "small function, big job" energy. let's get into it π«Ά
β¨ NAME β¨
nf_flow_table_extend_ct_timeout β extends the ct timeout of an offloaded conntrack entry. that's literally the whole vibe. π
π¦ SYNOPSIS π¦
void nf_flow_table_extend_ct_timeout (struct nf_conn *ct );
one function, one argument, zero drama. slay.
π ARGUMENTS π
ctβ the flowtable offloaded ct. like, the conntrack entry that's already been offloaded. hand it over and it gets its timeout extended. that's it, that's the whole argument π§
π DESCRIPTION π
okay so picture this. datapath lookups in the conntrack table will evict nf_conn entries if they have expired. expired = gone, no cap. π
now here's the plot twist π β once nf_conn entries have been offloaded, nf_conntrack might not see any packets anymore. and because of that, ct->timeout is no longer refreshed, which means ct can be evicted. not the main character ending we wanted fr fr.
so how do we fix it? instead of doing an additional check on the offload bit for every single packet processed via nf_conntrack_in, we just set an arbitrary timeout large enough not to ever expire. that way we skip the check for the IPS_OFFLOAD_BIT from the packet path via nf_ct_is_expired. iconic efficiency honestly π
lowkey the whole point is: one big arbitrary timeout now, so you don't have to do a per-packet check later. it's the tradeoff and it ate. π₯
π SEE ALSO π
- Kernel file
./net/netfilter/nf_flow_table_core.cβ go read it bestie, it's right there π nf_flow_table_tcp_timeout(9)β the sibling function, also very much worth a look β
and that's the page!! π this one lives under ./net/netfilter, it's dated October 2026, and yes the title really is nf_flow_tab...d_ct_timeout(9) (they truncated it, not me, don't come for me π). anyway ily, go extend those timeouts, periodt. πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms