Logical opreator '||' would always result in 'TRUE',
allowing any arbitrary conns_per_peer value to be set.
Change Logical operator from '||' to '&&' to correctly
compare that the value is within range.
Test-Parameters: trivial testlist=sanity-lnet
Fixes:
9b05e872482e ("LU-10391 lnet: support updating LNet local NI settings")
CoverityID: 415060 ("Logically dead code")
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: Ibcaf18060cae1fc62fe41ee6237abaad1fd2de7f
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54326
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
break;
case LNET_NET_O2IBLND_TUNABLES_ATTR_CONNS_PER_PEER:
num = nla_get_s64(attr);
- if (num > -1 || num < 128)
+ if (num >= 0 && num < 128)
tunables->lnd_tun_u.lnd_o2ib.lnd_conns_per_peer = num;
else
rc = -ERANGE;