Skip to content

Commit

Permalink
netfilter: nf_tables: elements with timeout below CONFIG_HZ never expire
Browse files Browse the repository at this point in the history
Element timeout that is below CONFIG_HZ never expires because the
timeout extension is not allocated given that nf_msecs_to_jiffies64()
returns 0. Set timeout to the minimum value to honor timeout.

Fixes: 8e1102d ("netfilter: nf_tables: support timeouts larger than 23 days")
Signed-off-by: Pablo Neira Ayuso <[email protected]>
  • Loading branch information
ummakynes committed Sep 3, 2024
1 parent c362646 commit e0c4728
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -4593,7 +4593,7 @@ int nf_msecs_to_jiffies64(const struct nlattr *nla, u64 *result)
return -ERANGE;

ms *= NSEC_PER_MSEC;
*result = nsecs_to_jiffies64(ms);
*result = nsecs_to_jiffies64(ms) ? : !!ms;
return 0;
}

Expand Down

0 comments on commit e0c4728

Please sign in to comment.