From: Benjamin Poirier Date: Mon, 5 Nov 2018 08:00:53 +0000 (+0900) Subject: xfrm: Fix bucket count reported to userspace X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ed04bb260d161cab36118537f888329712ad4abe;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git xfrm: Fix bucket count reported to userspace [ Upstream commit ca92e173ab34a4f7fc4128bd372bd96f1af6f507 ] 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 Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin --- diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 6c4ec69e11a0..0cd2bdf3b217 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -789,7 +789,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); }