diff options
author | Benjamin Poirier <bpoirier@suse.com> | 2018-11-05 17:00:53 +0900 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2018-11-06 12:25:47 +0100 |
commit | ca92e173ab34a4f7fc4128bd372bd96f1af6f507 (patch) | |
tree | 1d53ea38238536af72f5703f3c54fbfb7362b32f /net/xfrm | |
parent | 533555e5cbb6aa2d77598917871ae5b579fe724b (diff) | |
download | linux-stable-ca92e173ab34a4f7fc4128bd372bd96f1af6f507.tar.gz linux-stable-ca92e173ab34a4f7fc4128bd372bd96f1af6f507.tar.bz2 linux-stable-ca92e173ab34a4f7fc4128bd372bd96f1af6f507.zip |
xfrm: Fix bucket count reported to userspace
sadhcnt is reported by `ip -s xfrm state count` as "buckets count", not the
hash mask.
Fixes: 28d8909bc790 ("[XFRM]: Export SAD info.")
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_state.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index b669262682c9..12cdb350c456 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -788,7 +788,7 @@ void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si) { spin_lock_bh(&net->xfrm.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(&net->xfrm.xfrm_state_lock); } |