child-sa: Pass the number of total policies tied to an SA to the kernel
This will be useful if the kernel backend has to know how many policies follow an SA install, for example if it must install all policies concurrently.
This commit is contained in:
@@ -847,6 +847,14 @@ METHOD(child_sa_t, add_policies, status_t,
|
||||
priority = this->trap ? POLICY_PRIORITY_ROUTED
|
||||
: POLICY_PRIORITY_DEFAULT;
|
||||
|
||||
enumerator = create_policy_enumerator(this);
|
||||
while (enumerator->enumerate(enumerator, &my_ts, &other_ts))
|
||||
{
|
||||
my_sa.policy_count++;
|
||||
other_sa.policy_count++;
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
|
||||
/* enumerate pairs of traffic selectors */
|
||||
enumerator = create_policy_enumerator(this);
|
||||
while (enumerator->enumerate(enumerator, &my_ts, &other_ts))
|
||||
|
||||
Reference in New Issue
Block a user