提交 ca92e173 编写于 作者: B Benjamin Poirier 提交者: Steffen Klassert

xfrm: Fix bucket count reported to userspace

sadhcnt is reported by `ip -s xfrm state count` as "buckets count", not the
hash mask.

Fixes: 28d8909b ("[XFRM]: Export SAD info.")
Signed-off-by: NBenjamin Poirier <bpoirier@suse.com>
Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
上级 533555e5
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册