Skip to content

Commit a356728

Browse files
committed
xfrm: Fix acquire state insertion.
A recent commit jumped over the dst hash computation and left the symbol uninitialized. Fix this by explicitly computing the dst hash before it is used. Fixes: 0045e3d ("xfrm: Cache used outbound xfrm states at the policy.") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
1 parent 9e1a6db commit a356728

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

net/xfrm/xfrm_state.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,6 +1470,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr,
14701470
x->km.state = XFRM_STATE_ACQ;
14711471
x->dir = XFRM_SA_DIR_OUT;
14721472
list_add(&x->km.all, &net->xfrm.state_all);
1473+
h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, encap_family);
14731474
XFRM_STATE_INSERT(bydst, &x->bydst,
14741475
net->xfrm.state_bydst + h,
14751476
x->xso.type);

0 commit comments

Comments
 (0)