Skip to content
Commit f7cf6447 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

tools: ynl-gen: fix single attribute structs with attr 0 only



Chuck run into an issue with a single-element attr-set which
only has an attr with value of 0. The search for max attr in
a struct records attrs with value larger than 0 only (max_val
is set to 0 at the start). Adjust the comparison, alternatively
max_val could be init'ed to -1. Somehow picking the last attr
of a value seems like a good idea in general.

Reported-by: default avatarChuck Lever III <chuck.lever@oracle.com>
Fixes: be5bea1c ("net: add basic C code generators for Netlink")
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ac3ad195
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