Commit 5ac18889 authored by Donald Hunter's avatar Donald Hunter Committed by Jakub Kicinski

tools: ynl: Initialise fixed headers to 0 in genetlink-legacy

This eliminates the need for e.g. --json '{"dp-ifindex":0}' which is not
too big a deal for ovs but will get tiresome for fixed header structs that
have many members.
Signed-off-by: default avatarDonald Hunter <donald.hunter@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6d6bae63
......@@ -541,7 +541,7 @@ class YnlFamily(SpecFamily):
if op.fixed_header:
fixed_header_members = self.consts[op.fixed_header].members
for m in fixed_header_members:
value = vals.pop(m.name)
value = vals.pop(m.name) if m.name in vals else 0
format = NlAttr.get_format(m.type, m.byte_order)
msg += format.pack(value)
for name, value in vals.items():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment