summaryrefslogtreecommitdiff
path: root/tools/net/ynl/ynl-gen-c.py
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-08-24 03:30:54 +0300
committerJakub Kicinski <kuba@kernel.org>2023-08-25 05:04:20 +0300
commitdc2ef94d892634fba912e4fdeb01cd1c19346c9a (patch)
treeed99ac3fb2f09837656325950bb085fac22664f7 /tools/net/ynl/ynl-gen-c.py
parenta149a3a13bbcc5b87ade9073b6f1c9584f85ab18 (diff)
downloadlinux-dc2ef94d892634fba912e4fdeb01cd1c19346c9a.tar.xz
tools: ynl-gen: fix collecting global policy attrs
We look for attributes inside do.request, but there's another layer of nesting in the spec, look inside do.request.attributes. This bug had no effect as all global policies we generate (fou) seem to be full, anyway, and we treat full and empty the same. Next patch will change the treatment of empty policies. Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://lore.kernel.org/r/20230824003056.1436637-4-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net/ynl/ynl-gen-c.py')
-rwxr-xr-xtools/net/ynl/ynl-gen-c.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py
index e27deb199a70..13d06931c045 100755
--- a/tools/net/ynl/ynl-gen-c.py
+++ b/tools/net/ynl/ynl-gen-c.py
@@ -978,7 +978,9 @@ class Family(SpecFamily):
for op_mode in ['do', 'dump']:
if op_mode in op:
- global_set.update(op[op_mode].get('request', []))
+ req = op[op_mode].get('request')
+ if req:
+ global_set.update(req.get('attributes', []))
self.global_policy = []
self.global_policy_set = attr_set_name