aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Poirier <bpoirier@suse.com>2018-11-05 17:00:53 +0900
committerMoyster <oysterized@gmail.com>2019-05-03 19:25:11 +0200
commitd7d6b0cff5cc182eca3fe76e483a9ef2e8bc748b (patch)
tree00f1ffb0250ef51cb72b7513d58035d12c44cebc
parentd2a9e8380b5ef3749d6588b9e5b8ca1a7f957e8f (diff)
xfrm: Fix bucket count reported to userspace
commit ca92e173ab34a4f7fc4128bd372bd96f1af6f507 upstream. sadhcnt is reported by `ip -s xfrm state count` as "buckets count", not the hash mask. Fixes: 28d8909bc790 ("[XFRM]: Export SAD info.") Change-Id: Id5d62663152dca9350ff09b4d5815bf6ce05f52b Signed-off-by: Benjamin Poirier <bpoirier@suse.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--net/xfrm/xfrm_state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 7475648f8..67fa5dc5e 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -648,7 +648,7 @@ void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si)
{
spin_lock_bh(&xfrm_state_lock);
si->sadcnt = net->xfrm.state_num;
- si->sadhcnt = net->xfrm.state_hmask;
+ si->sadhcnt = net->xfrm.state_hmask + 1;
si->sadhmcnt = xfrm_state_hashmax;
spin_unlock_bh(&xfrm_state_lock);
}