summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_spd_fp_lookup.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ipsec/ipsec_spd_fp_lookup.h')
-rw-r--r--src/vnet/ipsec/ipsec_spd_fp_lookup.h48
1 files changed, 29 insertions, 19 deletions
diff --git a/src/vnet/ipsec/ipsec_spd_fp_lookup.h b/src/vnet/ipsec/ipsec_spd_fp_lookup.h
index 71260855317..2bbd7c664f9 100644
--- a/src/vnet/ipsec/ipsec_spd_fp_lookup.h
+++ b/src/vnet/ipsec/ipsec_spd_fp_lookup.h
@@ -196,13 +196,16 @@ ipsec_fp_in_ip6_policy_match_n (void *spd_fp, ipsec_fp_5tuple_t *tuples,
{
policy = im->policies + *policy_id;
- if ((last_priority[i] < policy->priority) &&
- (single_rule_in_match_5tuple (policy, match)))
+ if (single_rule_in_match_5tuple (policy, match))
{
- last_priority[i] = policy->priority;
- if (policies[i] == 0)
- counter++;
- policies[i] = policy;
+ if (last_priority[i] < policy->priority)
+ {
+ last_priority[i] = policy->priority;
+ if (policies[i] == 0)
+ counter++;
+ policies[i] = policy;
+ }
+ break;
}
}
}
@@ -291,13 +294,16 @@ ipsec_fp_in_ip4_policy_match_n (void *spd_fp, ipsec_fp_5tuple_t *tuples,
{
policy = im->policies + *policy_id;
- if ((last_priority[i] < policy->priority) &&
- (single_rule_in_match_5tuple (policy, match)))
+ if (single_rule_in_match_5tuple (policy, match))
{
- last_priority[i] = policy->priority;
- if (policies[i] == 0)
- counter++;
- policies[i] = policy;
+ if (last_priority[i] < policy->priority)
+ {
+ last_priority[i] = policy->priority;
+ if (policies[i] == 0)
+ counter++;
+ policies[i] = policy;
+ }
+ break;
}
}
}
@@ -418,6 +424,7 @@ ipsec_fp_out_ip6_policy_match_n (void *spd_fp, ipsec_fp_5tuple_t *tuples,
policies[i] = policy;
ids[i] = *policy_id;
}
+ break;
}
}
}
@@ -511,14 +518,17 @@ ipsec_fp_out_ip4_policy_match_n (void *spd_fp, ipsec_fp_5tuple_t *tuples,
{
policy = im->policies + *policy_id;
- if ((last_priority[i] < policy->priority) &&
- (single_rule_out_match_5tuple (policy, match)))
+ if (single_rule_out_match_5tuple (policy, match))
{
- last_priority[i] = policy->priority;
- if (policies[i] == 0)
- counter++;
- policies[i] = policy;
- ids[i] = *policy_id;
+ if (last_priority[i] < policy->priority)
+ {
+ last_priority[i] = policy->priority;
+ if (policies[i] == 0)
+ counter++;
+ policies[i] = policy;
+ ids[i] = *policy_id;
+ }
+ break;
}
}
}