netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Davidson <davidson.brian@gmail.com>
To: netfilter@vger.kernel.org
Subject: meta time rules display after 00:00 UTC
Date: Tue, 31 Oct 2023 14:53:45 -0400	[thread overview]
Message-ID: <CAOoaxdFXq6aJJMrFC40PRqd7ZTJDroRVh-BpH8Vz7H618V5GYQ@mail.gmail.com> (raw)

meta hour rules don't display properly after being created when the
hour is on or after 00:00 UTC. The netlink debug looks correct for
seconds past midnight UTC, but displaying the rules looks like an
overflow or a byte order problem. I am in UTC-0400, so today, 20:00
and later exhibits the problem, while 19:00 and earlier hours are
fine.

nft add table ip t
nft add chain ip t c
nft add rule ip t c meta hour "19:00"-"19:59" counter
nft add rule ip t c meta hour "20:00"-"20:59" counter
nft list table ip t
table ip t {
        chain c {
                meta hour "19:00"-"19:59" counter packets 0 bytes 0
                meta hour "1193042:28:16"-"1193043:27:16" counter
packets 0 bytes 0
        }
}

# nft -d netlink -c add rule ip t c meta hour "20:00"-"20:59" counter
ip t c
  [ meta load hour => reg 1 ]
  [ byteorder reg 1 = hton(reg 1, 4, 4) ]
  [ cmp gte reg 1 0x00000000 ]
  [ cmp lte reg 1 0xd40d0000 ]
  [ counter pkts 0 bytes 0 ]

# date
Tue Oct 31 02:47:31 PM EDT 2023
# nft -v
nftables v1.0.6 (Lester Gooch #5)
# uname -a
Linux router 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1
(2023-09-29) x86_64 GNU/Linux

             reply	other threads:[~2023-10-31 18:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-31 18:53 Brian Davidson [this message]
2023-11-02 10:26 ` meta time rules display after 00:00 UTC Florian Westphal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOoaxdFXq6aJJMrFC40PRqd7ZTJDroRVh-BpH8Vz7H618V5GYQ@mail.gmail.com \
    --to=davidson.brian@gmail.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).