mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
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>
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user