All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
	andrew+netdev@lunn.ch, horms@kernel.org, donald.hunter@gmail.com,
	ast@fiberby.net, i.maximets@ovn.org, one-d-wide@protonmail.com,
	fw@strlen.de, pablo@netfilter.org,
	netfilter-devel@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	Sashiko <netdev-bot+sashiko@kernel.org>
Subject: [PATCH net-next 1/7] netlink: specs: conntrack: timestamp is a nest, not a be64
Date: Wed,  9 Sep 2026 17:38:45 -0700	[thread overview]
Message-ID: <20260910003852.2184031-2-kuba@kernel.org> (raw)
In-Reply-To: <20260910003852.2184031-1-kuba@kernel.org>

ctnetlink_dump_timestamp() wraps CTA_TIMESTAMP_START
and CTA_TIMESTAMP_STOP in a nest, but the spec declares CTA_TIMESTAMP
as a flat be64. ynl picks reply attributes out of the attribute set rather
than the operation's attribute list, so the mistyped attribute stops
the whole dump:

  Error decoding 'timestamp' from 'conntrack-attrs'
  Traceback (most recent call last):
    File "tools/net/ynl/pyynl/cli.py", line 314, in main
      reply = ynl.dump(args.dump, attrs)
    File "tools/net/ynl/pyynl/lib/ynl.py", line 1082, in _decode
      decoded = attr.as_scalar(attr_spec['type'], attr_spec.byte_order)
    File "tools/net/ynl/pyynl/lib/ynl.py", line 291, in as_scalar
      return format_.unpack(self.raw)[0]
  struct.error: unpack requires a buffer of 8 bytes

The tstamp extension is only attached when CONFIG_NF_CONNTRACK_TIMESTAMP
is enabled and nf_conntrack_timestamp is turned on, which is off by default
and is why every dump does not hit this.

stop is omitted for live entries, so it stays optional like every other
member here.  The pad member mirrors counter-attrs, which covers the same
nla_put_be64() padding.

Reported-by: Sashiko <netdev-bot+sashiko@kernel.org>
Closes: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260826220444.4054714-1-i.maximets@ovn.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 Documentation/netlink/specs/conntrack.yaml | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/Documentation/netlink/specs/conntrack.yaml b/Documentation/netlink/specs/conntrack.yaml
index b1eb102ab843..2b7f16cc4133 100644
--- a/Documentation/netlink/specs/conntrack.yaml
+++ b/Documentation/netlink/specs/conntrack.yaml
@@ -345,6 +345,20 @@ doc: >-
       -
         name: secctx-name
         type: string
+  -
+    name: timestamp-attrs
+    attributes:
+      -
+        name: start
+        type: u64
+        byte-order: big-endian
+      -
+        name: stop
+        type: u64
+        byte-order: big-endian
+      -
+        name: pad
+        type: pad
   -
     name: synproxy-attrs
     attributes:
@@ -458,8 +472,8 @@ doc: >-
         nested-attributes: secctx-attrs
       -
         name: timestamp
-        type: u64
-        byte-order: big-endian
+        type: nest
+        nested-attributes: timestamp-attrs
       -
         name: mark-mask
         type: u32
-- 
2.55.0


  reply	other threads:[~2026-09-10  0:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10  0:38 [PATCH net-next 0/7] netlink: specs: conntrack: minor spec fixes Jakub Kicinski
2026-09-10  0:38 ` Jakub Kicinski [this message]
2026-09-10  0:38 ` [PATCH net-next 2/7] netlink: specs: conntrack: fix the get reply attribute lists Jakub Kicinski
2026-09-10  0:38 ` [PATCH net-next 3/7] netlink: specs: conntrack: fix SCTP conntrack state names Jakub Kicinski
2026-09-10  0:38 ` [PATCH net-next 4/7] netlink: specs: conntrack: fix the nat-attrs attribute IDs Jakub Kicinski
2026-09-10  0:38 ` [PATCH net-next 5/7] netlink: specs: conntrack: describe CTA_HELP_INFO Jakub Kicinski
2026-09-10  0:38 ` [PATCH net-next 6/7] netlink: specs: conntrack: fix the per-CPU stats reply Jakub Kicinski
2026-09-10  0:38 ` [PATCH net-next 7/7] netlink: specs: conntrack: tweak definition of obsolete attrs Jakub Kicinski
2026-09-10  6:40 ` [PATCH net-next 0/7] netlink: specs: conntrack: minor spec fixes Hangbin Liu

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=20260910003852.2184031-2-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@fiberby.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=horms@kernel.org \
    --cc=i.maximets@ovn.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=one-d-wide@protonmail.com \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.