Skip to content

Commit dc2ef94

Browse files
committed
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>
1 parent a149a3a commit dc2ef94

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/net/ynl/ynl-gen-c.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,9 @@ def _load_global_policy(self):
978978

979979
for op_mode in ['do', 'dump']:
980980
if op_mode in op:
981-
global_set.update(op[op_mode].get('request', []))
981+
req = op[op_mode].get('request')
982+
if req:
983+
global_set.update(req.get('attributes', []))
982984

983985
self.global_policy = []
984986
self.global_policy_set = attr_set_name

0 commit comments

Comments
 (0)