]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm6_tunnel: Fix spi check in __xfrm6_tunnel_alloc_spi
authorYueHaibing <yuehaibing@huawei.com>
Wed, 19 Dec 2018 06:45:09 +0000 (14:45 +0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 19 Dec 2018 11:33:17 +0000 (12:33 +0100)
commit598c1c4fb7fab1ad74362e9d82628db64c047d39
tree7569a640cb733f84f1849f1793cac61a5ab183df
parent710d79f0b0b6559eb09cb05ad1301b444d5de958
xfrm6_tunnel: Fix spi check in __xfrm6_tunnel_alloc_spi

gcc warn this:

net/ipv6/xfrm6_tunnel.c:143 __xfrm6_tunnel_alloc_spi() warn:
 always true condition '(spi <= 4294967295) => (0-u32max <= u32max)'

'spi' is u32, which always not greater than XFRM6_TUNNEL_SPI_MAX
because of wrap around. So the second forloop will never reach.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv6/xfrm6_tunnel.c