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: 28d8909bc7
("[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>
This commit is contained in:
parent
c7f8cde37a
commit
d96a964282
|
@ -648,7 +648,7 @@ void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si)
|
||||||
{
|
{
|
||||||
spin_lock_bh(&xfrm_state_lock);
|
spin_lock_bh(&xfrm_state_lock);
|
||||||
si->sadcnt = net->xfrm.state_num;
|
si->sadcnt = net->xfrm.state_num;
|
||||||
si->sadhcnt = net->xfrm.state_hmask;
|
si->sadhcnt = net->xfrm.state_hmask + 1;
|
||||||
si->sadhmcnt = xfrm_state_hashmax;
|
si->sadhmcnt = xfrm_state_hashmax;
|
||||||
spin_unlock_bh(&xfrm_state_lock);
|
spin_unlock_bh(&xfrm_state_lock);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue