aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/sa
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2013-04-06 14:16:30 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2013-04-06 14:16:30 +0200
commit12fa1784d0099791a3cb291d4331352b6cf9ec82 (patch)
treef710e21f62340d47c22a763b4e1f21547db342f3 /src/libcharon/sa
parentba2880d569989b55b9eb25e1cd4c630bf438f2b0 (diff)
downloadstrongswan-12fa1784d0099791a3cb291d4331352b6cf9ec82.tar.bz2
strongswan-12fa1784d0099791a3cb291d4331352b6cf9ec82.tar.xz
emit a single assig_vips bus message for all VIPs
Diffstat (limited to 'src/libcharon/sa')
-rw-r--r--src/libcharon/sa/ike_sa.c14
-rw-r--r--src/libcharon/sa/ikev2/tasks/ike_config.c2
2 files changed, 10 insertions, 6 deletions
diff --git a/src/libcharon/sa/ike_sa.c b/src/libcharon/sa/ike_sa.c
index 050279a49..63c04d9c0 100644
--- a/src/libcharon/sa/ike_sa.c
+++ b/src/libcharon/sa/ike_sa.c
@@ -766,7 +766,6 @@ METHOD(ike_sa_t, add_virtual_ip, void,
else
{
this->other_vips->insert_last(this->other_vips, ip->clone(ip));
- charon->bus->assign_vip(charon->bus, &this->public, ip, TRUE);
}
}
@@ -777,6 +776,10 @@ METHOD(ike_sa_t, clear_virtual_ips, void,
linked_list_t *vips = local ? this->my_vips : this->other_vips;
host_t *vip;
+ if (!local && vips->get_count(vips))
+ {
+ charon->bus->assign_vips(charon->bus, &this->public, FALSE);
+ }
while (vips->remove_first(vips, (void**)&vip) == SUCCESS)
{
if (local)
@@ -784,10 +787,6 @@ METHOD(ike_sa_t, clear_virtual_ips, void,
hydra->kernel_interface->del_ip(hydra->kernel_interface,
vip, -1, TRUE);
}
- else
- {
- charon->bus->assign_vip(charon->bus, &this->public, vip, FALSE);
- }
vip->destroy(vip);
}
}
@@ -2110,6 +2109,10 @@ METHOD(ike_sa_t, destroy, void,
vip->destroy(vip);
}
this->my_vips->destroy(this->my_vips);
+ if (this->other_vips->get_count(this->other_vips))
+ {
+ charon->bus->assign_vips(charon->bus, &this->public, FALSE);
+ }
while (this->other_vips->remove_last(this->other_vips,
(void**)&vip) == SUCCESS)
{
@@ -2124,7 +2127,6 @@ METHOD(ike_sa_t, destroy, void,
hydra->attributes->release_address(hydra->attributes, pools, vip, id);
pools->destroy(pools);
}
- charon->bus->assign_vip(charon->bus, &this->public, vip, FALSE);
vip->destroy(vip);
}
this->other_vips->destroy(this->other_vips);
diff --git a/src/libcharon/sa/ikev2/tasks/ike_config.c b/src/libcharon/sa/ikev2/tasks/ike_config.c
index d637c26fe..17132feee 100644
--- a/src/libcharon/sa/ikev2/tasks/ike_config.c
+++ b/src/libcharon/sa/ikev2/tasks/ike_config.c
@@ -387,6 +387,8 @@ METHOD(task_t, build_r, status_t,
pools->destroy(pools);
return SUCCESS;
}
+ charon->bus->assign_vips(charon->bus, this->ike_sa, TRUE);
+
if (pools->get_count(pools) && !this->vips->get_count(this->vips))
{
DBG1(DBG_IKE, "expected a virtual IP request, sending %N",