diff options
author | Martin Willi <martin@revosec.ch> | 2012-12-10 17:04:26 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-12-10 17:04:26 +0100 |
commit | 251b740712a034a20f70da2cdfd3e5ea02f61e81 (patch) | |
tree | 3684b25c66d639368145e46de36176658c9b205b /src | |
parent | 43b4c2ea75ff5434730988f4c3a7cd0ac33ae6fd (diff) | |
download | strongswan-251b740712a034a20f70da2cdfd3e5ea02f61e81.tar.bz2 strongswan-251b740712a034a20f70da2cdfd3e5ea02f61e81.tar.xz |
Migrate cache and fire lookip events for unique_id change during IKE_SA rekey
Diffstat (limited to 'src')
-rw-r--r-- | src/libcharon/plugins/lookip/lookip_listener.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libcharon/plugins/lookip/lookip_listener.c b/src/libcharon/plugins/lookip/lookip_listener.c index 3a67eae08..f1f630f37 100644 --- a/src/libcharon/plugins/lookip/lookip_listener.c +++ b/src/libcharon/plugins/lookip/lookip_listener.c @@ -227,6 +227,18 @@ METHOD(listener_t, ike_updown, bool, return TRUE; } +METHOD(listener_t, ike_rekey, bool, + private_lookip_listener_t *this, ike_sa_t *old, ike_sa_t *new) +{ + /* During IKE_SA rekey, the unique identifier changes. Fire update events + * and update the cached entry. During the invocation of this hook, the + * virutal IPs have been migrated to new, hence remove that entry. */ + remove_entry(this, new); + add_entry(this, new); + + return TRUE; +} + METHOD(lookip_listener_t, lookup, int, private_lookip_listener_t *this, host_t *vip, lookip_callback_t cb, void *user) @@ -299,6 +311,7 @@ lookip_listener_t *lookip_listener_create() .listener = { .message = _message_hook, .ike_updown = _ike_updown, + .ike_rekey = _ike_rekey, }, .lookup = _lookup, .add_listener = _add_listener, |