For route setup a hops value of -1 is valid. We were assuming
userland would never send a -1 which is wrong.
Test-Parameters: trivial testlist=sanity-lnet
Fixes:
6557cd4b8c8 ("LU-10391 lnet: migrate router management to Netlink")
Change-Id: I616334fccfe3aba6409f1a856c62cf02d07782a9
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53019
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
}
hops = nla_get_s64(route_prop);
- if (hops < 1 || hops > 255) {
+ if ((hops < 1 || hops > 255) && hops != -1) {
GENL_SET_ERR_MSG(info,
"invalid hop count must be between 1 and 255");
GOTO(report_err, rc = -EINVAL);