aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2017-08-07 12:13:06 +0200
committerTobias Brunner <tobias@strongswan.org>2017-08-07 14:22:13 +0200
commit859dae255c9d522c903eb058cc40163afabc3680 (patch)
treed3ad665f1e241ac56b1e752e8a29912f0b949919
parent11ddda2ecdc372707485bd847a322288d1bea858 (diff)
downloadstrongswan-859dae255c9d522c903eb058cc40163afabc3680.tar.bz2
strongswan-859dae255c9d522c903eb058cc40163afabc3680.tar.xz
child-sa: Suppress CHILD_SA state changes if there is no change
-rw-r--r--src/libcharon/sa/child_sa.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/libcharon/sa/child_sa.c b/src/libcharon/sa/child_sa.c
index 6c6804c64..422526774 100644
--- a/src/libcharon/sa/child_sa.c
+++ b/src/libcharon/sa/child_sa.c
@@ -296,12 +296,15 @@ METHOD(child_sa_t, get_config, child_cfg_t*,
METHOD(child_sa_t, set_state, void,
private_child_sa_t *this, child_sa_state_t state)
{
- DBG2(DBG_CHD, "CHILD_SA %s{%d} state change: %N => %N",
- get_name(this), this->unique_id,
- child_sa_state_names, this->state,
- child_sa_state_names, state);
- charon->bus->child_state_change(charon->bus, &this->public, state);
- this->state = state;
+ if (this->state != state)
+ {
+ DBG2(DBG_CHD, "CHILD_SA %s{%d} state change: %N => %N",
+ get_name(this), this->unique_id,
+ child_sa_state_names, this->state,
+ child_sa_state_names, state);
+ charon->bus->child_state_change(charon->bus, &this->public, state);
+ this->state = state;
+ }
}
METHOD(child_sa_t, get_state, child_sa_state_t,