All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] Doc: netlink: support unterminated-ok
@ 2024-03-07  7:01 Hangbin Liu
  2024-03-08  4:35 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Hangbin Liu @ 2024-03-07  7:01 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	linux-kernel, Hangbin Liu

ynl-gen-c.py supports check unterminated-ok, but the yaml schemas don't
have this key. Add this to the yaml files.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 Documentation/netlink/genetlink-c.yaml      | 3 +++
 Documentation/netlink/genetlink-legacy.yaml | 3 +++
 Documentation/netlink/genetlink.yaml        | 3 +++
 Documentation/netlink/netlink-raw.yaml      | 3 +++
 4 files changed, 12 insertions(+)

diff --git a/Documentation/netlink/genetlink-c.yaml b/Documentation/netlink/genetlink-c.yaml
index c58f7153fcf8..7094d619cbb6 100644
--- a/Documentation/netlink/genetlink-c.yaml
+++ b/Documentation/netlink/genetlink-c.yaml
@@ -208,6 +208,9 @@ properties:
                   exact-len:
                     description: Exact length for a string or a binary attribute.
                     $ref: '#/$defs/len-or-define'
+                  unterminated-ok:
+                    description: Allow the string to not use terminator.
+                    type: boolean
               sub-type: *attr-type
               display-hint: &display-hint
                 description: |
diff --git a/Documentation/netlink/genetlink-legacy.yaml b/Documentation/netlink/genetlink-legacy.yaml
index 938703088306..aceb72175365 100644
--- a/Documentation/netlink/genetlink-legacy.yaml
+++ b/Documentation/netlink/genetlink-legacy.yaml
@@ -251,6 +251,9 @@ properties:
                   exact-len:
                     description: Exact length for a string or a binary attribute.
                     $ref: '#/$defs/len-or-define'
+                  unterminated-ok:
+                    description: Allow the string to not use terminator.
+                    type: boolean
               sub-type: *attr-type
               display-hint: *display-hint
               # Start genetlink-c
diff --git a/Documentation/netlink/genetlink.yaml b/Documentation/netlink/genetlink.yaml
index 3283bf458ff1..f6d5ea44bf86 100644
--- a/Documentation/netlink/genetlink.yaml
+++ b/Documentation/netlink/genetlink.yaml
@@ -175,6 +175,9 @@ properties:
                   exact-len:
                     description: Exact length for a string or a binary attribute.
                     $ref: '#/$defs/len-or-define'
+                  unterminated-ok:
+                    description: Allow the string to not use terminator.
+                    type: boolean
               sub-type: *attr-type
               display-hint: &display-hint
                 description: |
diff --git a/Documentation/netlink/netlink-raw.yaml b/Documentation/netlink/netlink-raw.yaml
index ac4e05415f2f..0e105f21080b 100644
--- a/Documentation/netlink/netlink-raw.yaml
+++ b/Documentation/netlink/netlink-raw.yaml
@@ -270,6 +270,9 @@ properties:
                   exact-len:
                     description: Exact length for a string or a binary attribute.
                     $ref: '#/$defs/len-or-define'
+                  unterminated-ok:
+                    description: Allow the string to not use terminator.
+                    type: boolean
               sub-type: *attr-type
               display-hint: *display-hint
               # Start genetlink-c
-- 
2.43.0


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

* Re: [PATCH net-next] Doc: netlink: support unterminated-ok
  2024-03-07  7:01 [PATCH net-next] Doc: netlink: support unterminated-ok Hangbin Liu
@ 2024-03-08  4:35 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2024-03-08  4:35 UTC (permalink / raw)
  To: Hangbin Liu
  Cc: netdev, David S. Miller, Eric Dumazet, Paolo Abeni, linux-kernel

On Thu,  7 Mar 2024 15:01:06 +0800 Hangbin Liu wrote:
> Subject: [PATCH net-next] Doc: netlink: support unterminated-ok

I'd use this subject:

	netlink: specs: support unterminated-ok

> ynl-gen-c.py supports check unterminated-ok, but the yaml schemas don't
> have this key. Add this to the yaml files.

> diff --git a/Documentation/netlink/genetlink-c.yaml b/Documentation/netlink/genetlink-c.yaml
> index c58f7153fcf8..7094d619cbb6 100644
> --- a/Documentation/netlink/genetlink-c.yaml
> +++ b/Documentation/netlink/genetlink-c.yaml
> @@ -208,6 +208,9 @@ properties:
>                    exact-len:
>                      description: Exact length for a string or a binary attribute.
>                      $ref: '#/$defs/len-or-define'
> +                  unterminated-ok:
> +                    description: Allow the string to not use terminator.
> +                    type: boolean

Can we expand the doc a little? How about:

	description: |
		For string attributes, do not check whether attribute
		contains the terminating null character.

Also maybe let's leave this out of the spec for:

	Documentation/netlink/genetlink.yaml

that spec is supposed to be simplified, supporting both string flavors
just complicates things.

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

end of thread, other threads:[~2024-03-08  4:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-07  7:01 [PATCH net-next] Doc: netlink: support unterminated-ok Hangbin Liu
2024-03-08  4:35 ` Jakub Kicinski

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.