• Jiri Pirko's avatar
    net: devlink: limit flash component name to match version returned by info_get() · f94b6063
    Jiri Pirko authored
    Limit the acceptance of component name passed to cmd_flash_update() to
    match one of the versions returned by info_get(), marked by version type.
    This makes things clearer and enforces 1:1 mapping between exposed
    version and accepted flash component.
    
    Check VERSION_TYPE_COMPONENT version type during cmd_flash_update()
    execution by calling info_get() with different "req" context.
    That causes info_get() to lookup the component name instead of
    filling-up the netlink message.
    
    Remove "UPDATE_COMPONENT" flag which becomes used.
    Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    f94b6063
devlink.c 326 KB