Whamcloud - gitweb
LU-10391 lnet: hops -1 is valid 19/53019/2
authorJames Simmons <jsimmons@infradead.org>
Tue, 7 Nov 2023 16:30:02 +0000 (11:30 -0500)
committerOleg Drokin <green@whamcloud.com>
Sat, 18 Nov 2023 21:42:24 +0000 (21:42 +0000)
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>
lnet/lnet/api-ni.c

index 4bc70c6..18159a3 100644 (file)
@@ -7413,7 +7413,7 @@ static int lnet_route_cmd(struct sk_buff *skb, struct genl_info *info)
                                }
 
                                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);