|
@@ -756,7 +756,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
|
|
struct xfrm_policy *pol, int *err,
|
|
struct xfrm_policy *pol, int *err,
|
|
unsigned short family)
|
|
unsigned short family)
|
|
{
|
|
{
|
|
- unsigned int h = xfrm_dst_hash(daddr, saddr, tmpl->reqid, family);
|
|
|
|
|
|
+ unsigned int h;
|
|
struct hlist_node *entry;
|
|
struct hlist_node *entry;
|
|
struct xfrm_state *x, *x0;
|
|
struct xfrm_state *x, *x0;
|
|
int acquire_in_progress = 0;
|
|
int acquire_in_progress = 0;
|
|
@@ -764,6 +764,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
|
|
struct xfrm_state *best = NULL;
|
|
struct xfrm_state *best = NULL;
|
|
|
|
|
|
spin_lock_bh(&xfrm_state_lock);
|
|
spin_lock_bh(&xfrm_state_lock);
|
|
|
|
+ h = xfrm_dst_hash(daddr, saddr, tmpl->reqid, family);
|
|
hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) {
|
|
hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) {
|
|
if (x->props.family == family &&
|
|
if (x->props.family == family &&
|
|
x->props.reqid == tmpl->reqid &&
|
|
x->props.reqid == tmpl->reqid &&
|
|
@@ -865,11 +866,12 @@ struct xfrm_state *
|
|
xfrm_stateonly_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
|
|
xfrm_stateonly_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
|
|
unsigned short family, u8 mode, u8 proto, u32 reqid)
|
|
unsigned short family, u8 mode, u8 proto, u32 reqid)
|
|
{
|
|
{
|
|
- unsigned int h = xfrm_dst_hash(daddr, saddr, reqid, family);
|
|
|
|
|
|
+ unsigned int h;
|
|
struct xfrm_state *rx = NULL, *x = NULL;
|
|
struct xfrm_state *rx = NULL, *x = NULL;
|
|
struct hlist_node *entry;
|
|
struct hlist_node *entry;
|
|
|
|
|
|
spin_lock(&xfrm_state_lock);
|
|
spin_lock(&xfrm_state_lock);
|
|
|
|
+ h = xfrm_dst_hash(daddr, saddr, reqid, family);
|
|
hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) {
|
|
hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) {
|
|
if (x->props.family == family &&
|
|
if (x->props.family == family &&
|
|
x->props.reqid == reqid &&
|
|
x->props.reqid == reqid &&
|