netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nft PATCH v2 0/3] evaluate: Fix for 'meta hour' ranges spanning date boundaries
@ 2025-07-29 16:18 Phil Sutter
  2025-07-29 16:18 ` [nft PATCH v2 1/3] expression: Introduce is_symbol_value_expr() macro Phil Sutter
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Phil Sutter @ 2025-07-29 16:18 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel

Kernel's timezone is UTC, so 'meta hour' returns seconds since UTC start
of day. To mach against this, user space has to convert the RHS value
given in local timezone into UTC. With ranges (e.g. 9:00-17:00),
depending on the local timezone, these may span midnight in UTC (e.g.
23:00-7:00) and thus need to be converted into a proper range again
(e.g. 7:00-23:00, inverted). Since nftables commit 347039f64509e ("src:
add symbol range expression to further compact intervals"), this
conversion was broken.

Changes since v1:
- Apply the parser changes of commit 347039f64509e to JSON parser as
  well (new patches 1 and 2)
- Misc fixes in patch 3

Phil Sutter (3):
  expression: Introduce is_symbol_value_expr() macro
  parser_json: Parse into symbol range expression if possible
  evaluate: Fix for 'meta hour' ranges spanning date boundaries

 doc/primary-expression.txt              |   3 +-
 include/expression.h                    |   2 +
 src/evaluate.c                          |  25 +++-
 src/parser_bison.y                      |   6 +-
 src/parser_json.c                       |  12 +-
 tests/py/any/meta.t                     |   9 ++
 tests/py/any/meta.t.json                | 182 ++++++++++++++++++++++++
 tests/py/any/meta.t.json.output         |  18 +++
 tests/py/any/meta.t.payload             |  51 +++++++
 tests/shell/testcases/listing/meta_time |  11 ++
 10 files changed, 306 insertions(+), 13 deletions(-)

-- 
2.49.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-07-30 17:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-29 16:18 [nft PATCH v2 0/3] evaluate: Fix for 'meta hour' ranges spanning date boundaries Phil Sutter
2025-07-29 16:18 ` [nft PATCH v2 1/3] expression: Introduce is_symbol_value_expr() macro Phil Sutter
2025-07-29 16:18 ` [nft PATCH v2 2/3] parser_json: Parse into symbol range expression if possible Phil Sutter
2025-07-29 16:18 ` [nft PATCH v2 3/3] evaluate: Fix for 'meta hour' ranges spanning date boundaries Phil Sutter
2025-07-30 17:26   ` Pablo Neira Ayuso
2025-07-30 16:38 ` [nft PATCH v2 0/3] " Pablo Neira Ayuso
2025-07-30 17:27   ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).