Commit 2472ddd6 authored by Willem de Bruijn's avatar Willem de Bruijn Committed by Zheng Zengkai
Browse files

selftests/net: ipsec: fix constant out of range

stable inclusion
from stable-v6.6.5
commit efd3358bc3d0f75554f110487a5d9133abb3f512
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8N21P

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=efd3358bc3d0f75554f110487a5d9133abb3f512



--------------------------------

[ Upstream commit 088559815477c6f623a5db5993491ddd7facbec7 ]

Fix a small compiler warning.

nr_process must be a signed long: it is assigned a signed long by
strtol() and is compared against LONG_MIN and LONG_MAX.

ipsec.c:2280:65:
    error: result of comparison of constant -9223372036854775808
    with expression of type 'unsigned int' is always false
    [-Werror,-Wtautological-constant-out-of-range-compare]

  if ((errno == ERANGE && (nr_process == LONG_MAX || nr_process == LONG_MIN))

Fixes: bc2652b7 ("selftest/net/xfrm: Add test for ipsec tunnel")
Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
Reviewed-by: default avatarDmitry Safonov <0x7f454c46@gmail.com>
Link: https://lore.kernel.org/r/20231124171645.1011043-2-willemdebruijn.kernel@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 44019275
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment