aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/netlink
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-10-18 09:39:16 -0700
committerJakub Kicinski <kuba@kernel.org>2023-10-19 15:54:56 -0700
commit668c1ac828fb546b81da6b36dae09d754bd0f59e (patch)
tree1df611d3228e128ff868bfc2b05ba7d9fffdbad4 /Documentation/netlink
parentee0a4cfcbdcc6a7b2b35dba475e68187ebdafbf1 (diff)
downloadlinux-668c1ac828fb546b81da6b36dae09d754bd0f59e.tar.gz
tools: ynl-gen: support full range of min/max checks for integer values
Extend the support to full range of min/max checks. None of the existing YNL families required complex integer validation. The support is less than trivial, because we try to keep struct nla_policy tiny the min/max members it holds in place are s16. Meaning we can only express checks in range of s16. For larger ranges we need to define a structure and link it in the policy. Link: https://lore.kernel.org/r/20231018163917.2514503-3-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'Documentation/netlink')
-rw-r--r--Documentation/netlink/genetlink-c.yaml3
-rw-r--r--Documentation/netlink/genetlink-legacy.yaml3
-rw-r--r--Documentation/netlink/genetlink.yaml3
3 files changed, 9 insertions, 0 deletions
diff --git a/Documentation/netlink/genetlink-c.yaml b/Documentation/netlink/genetlink-c.yaml
index f9366aaddd210c..75af0b51f3d7e8 100644
--- a/Documentation/netlink/genetlink-c.yaml
+++ b/Documentation/netlink/genetlink-c.yaml
@@ -184,6 +184,9 @@ properties:
min:
description: Min value for an integer attribute.
type: integer
+ max:
+ description: Max value for an integer attribute.
+ type: integer
min-len:
description: Min length for a binary attribute.
$ref: '#/$defs/len-or-define'
diff --git a/Documentation/netlink/genetlink-legacy.yaml b/Documentation/netlink/genetlink-legacy.yaml
index a6a490333a1ab5..c0f17a8bfe0d08 100644
--- a/Documentation/netlink/genetlink-legacy.yaml
+++ b/Documentation/netlink/genetlink-legacy.yaml
@@ -227,6 +227,9 @@ properties:
min:
description: Min value for an integer attribute.
type: integer
+ max:
+ description: Max value for an integer attribute.
+ type: integer
min-len:
description: Min length for a binary attribute.
$ref: '#/$defs/len-or-define'
diff --git a/Documentation/netlink/genetlink.yaml b/Documentation/netlink/genetlink.yaml
index 2b788e607a1432..4fd56e3b1553cc 100644
--- a/Documentation/netlink/genetlink.yaml
+++ b/Documentation/netlink/genetlink.yaml
@@ -157,6 +157,9 @@ properties:
min:
description: Min value for an integer attribute.
type: integer
+ max:
+ description: Max value for an integer attribute.
+ type: integer
min-len:
description: Min length for a binary attribute.
$ref: '#/$defs/len-or-define'