netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfrm: Fix bucket count reported to userspace
@ 2018-11-05  8:00 Benjamin Poirier
  2018-11-07 12:12 ` Steffen Klassert
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Poirier @ 2018-11-05  8:00 UTC (permalink / raw)
  To: Steffen Klassert, Jamal Hadi Salim; +Cc: Herbert Xu, David S. Miller, netdev

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>
---
 net/xfrm/xfrm_state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
 }
-- 
2.19.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfrm: Fix bucket count reported to userspace
  2018-11-05  8:00 [PATCH] xfrm: Fix bucket count reported to userspace Benjamin Poirier
@ 2018-11-07 12:12 ` Steffen Klassert
  0 siblings, 0 replies; 2+ messages in thread
From: Steffen Klassert @ 2018-11-07 12:12 UTC (permalink / raw)
  To: Benjamin Poirier; +Cc: Jamal Hadi Salim, Herbert Xu, David S. Miller, netdev

On Mon, Nov 05, 2018 at 05:00:53PM +0900, Benjamin Poirier wrote:
> 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>

Patch applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-07 21:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-05  8:00 [PATCH] xfrm: Fix bucket count reported to userspace Benjamin Poirier
2018-11-07 12:12 ` Steffen Klassert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).