The use of the | operator always leads to true which looks rather
suspect to me. Fix this by using & instead to just check the
RTF_CACHE entry bit.
Detected by CoverityScan, CID#
1457734, #
1457747 ("Wrong operator used")
Fixes:
35732d01fe31 ("ipv6: introduce a hash table to store dst cache")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Wei Wang <weiwan@google.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
int err;
if (!from ||
- !(rt->rt6i_flags | RTF_CACHE))
+ !(rt->rt6i_flags & RTF_CACHE))
return -EINVAL;
if (!rcu_access_pointer(from->rt6i_exception_bucket))
struct rt6_exception *rt6_ex;
if (!from ||
- !(rt->rt6i_flags | RTF_CACHE))
+ !(rt->rt6i_flags & RTF_CACHE))
return;
rcu_read_lock();